Neon Serverless Driver issue

I am using @neondatabase/serverless, and auth.ts looks like this:
export const auth = betterAuth({ database: neon(process.env.DATABASE_URL!) });
export const auth = betterAuth({ database: neon(process.env.DATABASE_URL!) });
And after running npx @better-auth/cli generate I get this error:
ERROR [Better Auth]: This function can now be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], options).
ERROR [Better Auth]: This function can now be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], options).
Solution:
You need a dialect for kysely https://github.com/kysely-org/kysely-neon For example:...
GitHub
GitHub - kysely-org/kysely-neon: Kysely dialect for Neon's serverle...
Kysely dialect for Neon's serverless driver over HTTP. - kysely-org/kysely-neon
Jump to solution
1 Reply
Solution
jslno
jslno2mo ago
You need a dialect for kysely https://github.com/kysely-org/kysely-neon For example:
export const auth = betterAuth(
database: {
dialect: new NeonDialect({
neon: neon(process.env.DATABASE_URL!),
}),
type: "postgres",
},
);
export const auth = betterAuth(
database: {
dialect: new NeonDialect({
neon: neon(process.env.DATABASE_URL!),
}),
type: "postgres",
},
);
GitHub
GitHub - kysely-org/kysely-neon: Kysely dialect for Neon's serverle...
Kysely dialect for Neon's serverless driver over HTTP. - kysely-org/kysely-neon

Did you find this page helpful?