Switched to Neon Websockets but now some queries are timing out

Hi everyone, I was using transactions for a specific query (needed all of them to cancel if one failed for a form builder). So I followed this tutorial to switch from Neon HTTP to Neon Websockets: https://orm.drizzle.team/docs/connect-neon But now I'm seeing that other queries are extremely slow & some are even failing (see attached screenshot)
Drizzle ORM - Neon
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
No description
1 Reply
MarvinKR
MarvinKROP4w ago
Tried this fix, can I combine both methods in a single drizzle file and use only dbPool for transactions?
import { Pool, neon } from "@neondatabase/serverless";
import { drizzle } from "drizzle-orm/neon-serverless";
import { drizzle as drizzleHttp } from "drizzle-orm/neon-http";
import * as schema from "@/db/schema";

const pool = new Pool({ connectionString: process.env.DATABASE_URL });
export const dbPool = drizzle(pool, { schema });

const sql = neon(process.env.DATABASE_URL!);
export const db = drizzleHttp(sql, { schema });
import { Pool, neon } from "@neondatabase/serverless";
import { drizzle } from "drizzle-orm/neon-serverless";
import { drizzle as drizzleHttp } from "drizzle-orm/neon-http";
import * as schema from "@/db/schema";

const pool = new Pool({ connectionString: process.env.DATABASE_URL });
export const dbPool = drizzle(pool, { schema });

const sql = neon(process.env.DATABASE_URL!);
export const db = drizzleHttp(sql, { schema });
@raoufchebri
Want results from more Discord servers?
Add your server