See the Postgres via Drizzle guide for usage examples and setup instructions.Documentation Index
Fetch the complete documentation index at: https://beta.docs.sqd.dev/llms.txt
Use this file to discover all available pages before exploring further.
drizzleTarget
| Parameter | Required | Description |
|---|---|---|
db | Yes | Drizzle NodePgDatabase instance. Must expose $client (a pg Pool or Client). |
tables | Yes | Tables tracked for automatic fork rollback. All tables written to in onData must appear here. |
onStart | No | Runs once before processing starts. Receives { db }. |
onData | Yes | Called for each batch inside a serializable transaction. |
onBeforeRollback | No | Called inside the rollback transaction before snapshots are replayed. |
onAfterRollback | No | Called inside the rollback transaction after snapshots are replayed. |
settings.state | No | Configuration for the internal cursor state table. See StateOptions below. |
settings.transaction.isolationLevel | No | Transaction isolation level. Defaults to 'serializable'. |
StateOptions:
| Field | Default | Description |
|---|---|---|
schema | 'public' | PostgreSQL schema for the state table. |
table | 'sync' | Name of the state table. |
id | 'stream' | Stream identifier within the state table. |
unfinalizedBlocksRetention | 1000 | Number of unfinalized blocks retained in state for rollback purposes. |
batchForInsert
Math.floor(32767 / columnsPerRecord) by default. Pass size to set a smaller cap; values exceeding the computed maximum are silently clamped.
chunk is a deprecated alias for batchForInsert.