Replies: 1 comment
|
No, bun:sql doesn't do COPY FROM STDIN yet (tested on 1.3.14). There's no copy/stream method on the sql object, and if you just send For now the fastest thing that actually works is bun:sql's multi-row INSERT helper: await sql`INSERT INTO t ${sql(rows)}`; // rows = array of objectsThat sends a single multi-row INSERT (checked the wire log, 1000 rows in one statement). Since drizzle-orm/bun-sql rides on top of bun:sql you hit the same limit, so use one |
Uh oh!
There was an error while loading. Please reload this page.
I'm using bun:sql (via Drizzle ORM / drizzle-orm/bun-sql) and need to
bulk insert large amounts of rows into a partitioned PostgreSQL table.
PostgreSQL's COPY FROM STDIN is significantly faster than multi-row
INSERT for this use case.
Questions:
COPY protocol through bun:sql?
All reactions