Skip to content

NuxtHub db config ignores driver options (prepare: false) for Supabase Transaction Pooler #840

@EmrullahAlku

Description

@EmrullahAlku

I am trying to connect to Supabase using the Transaction Pooler (Port 6543. While the direct connection via Port 5432 works perfectly, the pooled connection fails.
This is likely because Supabase's transaction mode does not support prepared statements, and the prepare: false option is either not being passed correctly to the underlying driver or is being overridden by NuxtHub's internal database initialization.

Current Configuration

I have attempted to configure the connection in nuxt.config.ts as follows, but without success:

hub: {  
  db: {  
    dialect: "postgresql",  
    driver: "postgres-js",  
    connection: {  
      connectionString: process.env.DATABASE\_URL, // Using Port 6543  
      prepare: false, // This option seems to be ignored or not passed to the client  
    },  
  },  
},

.env

DATABASE_URL="postgresql://postgres.[PROJECT_ID]:[PASSWORD]@[REGION].pooler.supabase.com:6543/postgres"

The Problem

  • Port 5432 (Direct): Works as expected.
  • Port 6543 (Transaction Pooler): Fails to establish a stable connection or throws errors related to prepared statements.

Silent Failure Behavior:
Crucially, the Nuxt application does not catch or throw any errors during the database operation. On the client side, the data appears to be created successfully (as if the transaction completed), but the records are never actually persisted in the Supabase database.

Error Logs From Supabase

{
  "event_message": "prepared statement \"e3f8f0ujpgm7\" does not exist",
  "application_name": "Supavisor",
  "sql_state_code": "26000",
  "error_severity": "ERROR"
}

Environment

  • Framework: Nuxt ^4.3.0
  • Module: @nuxthub/core ^0.10.5
  • Database: Supabase PostgreSQL
  • Connection Mode: Transaction Mode (Port 6543
  • ORM: drizzle-orm ^0.45.1

 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions