drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
23.53k stars 577 forks source link

[BUG]: Property 'batch' does not exist on type 'NeonDatabase' #2980

Open JJZFIVE opened 2 weeks ago

JJZFIVE commented 2 weeks ago

What version of drizzle-orm are you using?

^0.33.0

What version of drizzle-kit are you using?

No response

Describe the Bug

When I try to use db.batch(), it gives me the error: Property 'batch' does not exist on type 'NeonDatabase'

I'm using Neon as my postgres provider and am initializing my db object as such:

import { drizzle } from "drizzle-orm/neon-serverless";
import { Config } from "../config";
import { Pool, neonConfig } from "@neondatabase/serverless";
import ws from "ws";
neonConfig.webSocketConstructor = ws;

import * as schema from "../../../shared/db/";

const pool = new Pool({
    connectionString: Config.POSTGRES_POOL_URI,
});

const db = drizzle(pool, { schema });
export default db;
export { pool };

Expected behavior

The Drizzle batch docs appear to claim support for Neon: https://orm.drizzle.team/docs/batch-api

Environment & setup

No response

sammyjoyce commented 15 hours ago

I've just run into the same issue. Did you find any resolution @JJZFIVE ?

Looks like it's only on 'drizzle-orm/neon-http', not serverless

JJZFIVE commented 4 hours ago

I've just run into the same issue. Did you find any resolution @JJZFIVE ?

Looks like it's only on 'drizzle-orm/neon-http', not serverless

Interesting. Drizzle team, is this expected behavior?