Compare commits

...
Author SHA1 Message Date
Wintermute af2c5dd05a fix(db): disable prepared statements by default for connection pooler compatibility
Supabase Supavisor and PgBouncer in transaction mode don't support
prepared statements because session state isn't preserved between queries.
While the URL param ?prepare=false handles this, setting it explicitly in
the connection options provides a safety net for any pooler configuration.

postgres.js defaults to prepare: true. This change makes gbrain work
correctly with transaction-mode poolers out of the box, matching the
recommendation in Supabase docs.

Ref: https://supabase.com/docs/guides/database/connecting-to-postgres#connection-pooler
2026-04-21 00:28:06 +00:00
+1
View File
@@ -57,6 +57,7 @@ export async function connect(config: EngineConfig): Promise<void> {
max: resolvePoolSize(),
idle_timeout: 20,
connect_timeout: 10,
prepare: false,
types: {
// Register pgvector type
bigint: postgres.BigInt,