Configuring the neon serverless driver to connect via pooling and websockets:
import { Pool } from "@neondatabase/serverless";
import { drizzle } from "drizzle-orm/neon-serverless";
const pool = new Pool({
connectionString: serverConfig.databaseConnectionString,
});
export const db = drizzle(pool, {});
Getting ‘The edge function timed out’ error as soon as the nextauth middleware (v5) [running on a edge function] tries to connect the database.
Does this mean I cannot define the connection at application startup?
I need to add the code to build up a new connection at the beginning of every function?