NeonN
Neon2y ago
10 replies
skinny-azure

NeonDbError: prepared statement "s4908" already exists

Getting the following error: NeonDbError: prepared statement "s4908" already exists
And now also: NeonDbError: prepared statement "s5046" does not exist
Not sure what could cause this, as I am not using prepared statements.

If it matters, I'm using Drizzle, and this is how I instantiate the db
import { Pool, neon } from '@neondatabase/serverless'
import { drizzle } from 'drizzle-orm/neon-http'
import { drizzle as drizzlePool } from 'drizzle-orm/neon-serverless'
import * as schema from './schema'
export * from 'drizzle-orm'
export type { PgEnum } from 'drizzle-orm/pg-core'
export * from './schema/index'
export { db, poolDb }

if (!process.env.DRIZZLE_DATABASE_URL) {
  throw new Error('Missing DRIZZLE_DATABASE_URL')
}
const sql = neon(process.env.DRIZZLE_DATABASE_URL!)

sql`CREATE EXTENSION IF NOT EXISTS vector`

const db = drizzle(sql, { schema })

const pool = new Pool({
  connectionString: process.env.DRIZZLE_DATABASE_URL,
})
const poolDb = drizzlePool(pool, { schema })
Was this page helpful?