Skip to content

feat(postgres): add support for batch and copyfrom#71

Draft
okuuva wants to merge 8 commits into
reload:mainfrom
huudot:push-ttmoxvkuplrq
Draft

feat(postgres): add support for batch and copyfrom#71
okuuva wants to merge 8 commits into
reload:mainfrom
huudot:push-ttmoxvkuplrq

Conversation

@okuuva

@okuuva okuuva commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

:batchexec, :batchone, and :batchmany have so far been supported only in Go, when using pgx/v4 or pgx/v5 driver. :copyfrom has been supported with other DBs as well but only in Go. This PR adds support for those annotations for Typescript when using postgres.js driver.

Other notable changes:

  • Adapted current test to use vitest
  • Refactored driver test helpers
  • Added integration and perf tests for the new annotations

@okuuva okuuva force-pushed the push-ttmoxvkuplrq branch from 82b69a0 to 453cdf7 Compare July 9, 2026 16:01
okuuva added 8 commits July 10, 2026 14:31
Generated postgres query helpers only require the shared query execution
surface exposed by both root `Sql` clients and transaction-scoped
`TransactionSql` clients.

Type normal query parameters as `Sql | TransactionSql` and import both
types type-only so callers can pass `tx` from `sql.begin(...)` without
casts.

Add strict type-check coverage proving generated query helpers accept
transaction clients.
`vitest` makes some of the upcoming tests more ergonomic.
Add live Postgres integration coverage for generated :batch and
:copyfrom helpers, plus opt-in perf comparisons for bulk and
latency-sensitive query patterns.

Run integration tests in CI against PostgreSQL 16.
@okuuva okuuva force-pushed the push-ttmoxvkuplrq branch from 453cdf7 to bc936b8 Compare July 10, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant