Skip to content

Add Drizzle ORM integration page - #546

Open
PasinduOshada wants to merge 1 commit into
questdb:mainfrom
PasinduOshada:docs/add-drizzle-orm-integration
Open

Add Drizzle ORM integration page#546
PasinduOshada wants to merge 1 commit into
questdb:mainfrom
PasinduOshada:docs/add-drizzle-orm-integration

Conversation

@PasinduOshada

@PasinduOshada PasinduOshada commented Sep 9, 2026

Copy link
Copy Markdown

Closes #70

Drizzle is a type-safe TypeScript SQL ORM. It has no QuestDB dialect, but reaches QuestDB over PGWire through node-postgres — already one of the tested JavaScript clients — so the page documents that path rather than proposing a new one.

Approach

I tried to write this the way Drizzle actually behaves against a time-series database rather than restating the Drizzle quickstart:

  • Describe, don't migrate. Tables are created with QuestDB DDL (or automatically by ILP) and the Drizzle schema describes what exists, since drizzle-kit emits DDL QuestDB does not implement.
  • Ingest over ILP. Follows the existing guidance in the PGWire docs — query with PGWire, ingest with the official client — with a worked Sender example rather than row-by-row INSERT.
  • Escape hatch for time-series SQL. SAMPLE BY, LATEST ON and ASOF JOIN have no query-builder equivalent, so the page shows db.execute(sql\...`)` with bound parameters.
  • A column type mapping table, including the SYMBOLtext() case that has no obvious answer.

Limitations section

Called out explicitly, since these are the things that will otherwise turn into issues: no drizzle-kit migrations, no DELETE statement, no primary or foreign keys (and therefore no relational query API), and limited transaction semantics.

Notes

  • Also registered in the Other Tools sidebar and the integrations overview, next to SQLAlchemy.
  • API calls checked against connect/clients/nodejs.md (Sender.fromConfig, .at(timestamp, "ms")) and DML claims against the SQL reference — there is no delete.md, and concepts/designated-timestamp.md states the designated timestamp is not a primary key.
  • All internal links used already resolve elsewhere in the repo, so the onBrokenLinks: "throw" build should pass.

I don't have a QuestDB instance to hand to run the snippets end to end, so a sanity check on the Drizzle examples would be welcome. Happy to adjust structure or trim the limitations list if you'd rather it read shorter.

Closes questdb#70

Drizzle is a type-safe TypeScript SQL ORM. It has no QuestDB dialect, but
reaches QuestDB over PGWire through node-postgres, which is already a tested
JavaScript client.

Document it the way it actually works against a time-series database: describe
existing tables rather than migrating into them, use the core select API for
filtering, drop to the sql template for SAMPLE BY, LATEST ON and ASOF JOIN,
and ingest over ILP with the official client rather than row-by-row INSERT.

Include a QuestDB-to-Drizzle column type mapping, and a limitations section
covering drizzle-kit migrations, the absent DELETE statement, the lack of
primary and foreign keys, and transaction semantics.

Register the page in the Other Tools sidebar and the integrations overview.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new third-party tool - Drizzle ORM

1 participant