From 7c35645512049152312596369b4da4af6bd3d81e Mon Sep 17 00:00:00 2001 From: Anh Viet Date: Wed, 17 Jul 2024 23:05:25 +0200 Subject: [PATCH 1/2] import fix --- src/commands/add/auth/lucia/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/add/auth/lucia/index.ts b/src/commands/add/auth/lucia/index.ts index be5c52c8..af739e0f 100644 --- a/src/commands/add/auth/lucia/index.ts +++ b/src/commands/add/auth/lucia/index.ts @@ -207,8 +207,8 @@ export type UsernameAndPassword = z.infer; encoding: "utf-8", }); const contentsImportsUpdated = dbTsContents.replace( - "{ neon, neonConfig }", - "{ neon, neonConfig, Pool }" + "{ neon, neonConfig, NeonQueryFunction }", + "{ neon, neonConfig, NeonQueryFunction, Pool }" ); const contentsWithPool = contentsImportsUpdated.concat( "\nexport const pool = new Pool({ connectionString: env.DATABASE_URL });" From b10b8520ec563fa4088963216b7e77f106445dbf Mon Sep 17 00:00:00 2001 From: Anh Viet Date: Wed, 17 Jul 2024 23:06:25 +0200 Subject: [PATCH 2/2] remove fetchConnectionCache config due to deprecation --- src/commands/add/orm/drizzle/generators.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/commands/add/orm/drizzle/generators.ts b/src/commands/add/orm/drizzle/generators.ts index 1750adbe..adbe282e 100644 --- a/src/commands/add/orm/drizzle/generators.ts +++ b/src/commands/add/orm/drizzle/generators.ts @@ -110,8 +110,8 @@ import { env } from "${formatFilePath(envMjs, { prefix: "alias", })}"; -neonConfig.fetchConnectionCache = true; - + + export const sql: NeonQueryFunction = neon(env.DATABASE_URL); export const db = drizzle(sql); `; @@ -282,8 +282,7 @@ import { migrate } from "drizzle-orm/neon-http/migrator"; import { neon, neonConfig, NeonQueryFunction } from '@neondatabase/serverless'; `; connectionLogic = ` -neonConfig.fetchConnectionCache = true; - + const sql: NeonQueryFunction = neon(env.DATABASE_URL); const db = drizzle(sql); `;