Skip to content

docs: add Drizzle ORM to third-party tools - #537

Open
PedroHenrique0713 wants to merge 1 commit into
questdb:mainfrom
PedroHenrique0713:docs/drizzle-orm
Open

docs: add Drizzle ORM to third-party tools#537
PedroHenrique0713 wants to merge 1 commit into
questdb:mainfrom
PedroHenrique0713:docs/drizzle-orm

Conversation

@PedroHenrique0713

Copy link
Copy Markdown
Contributor

Closes #70.

This picks up where #71 stopped. That PR had @nwoolmer's go-ahead and only needed the example aligned to the trades table; the author made the change, asked for another review in October 2024, and the PR went stale and was closed six months later without landing. Credit for the original idea and first draft goes to @Mrinank-Bhowmick. This is a fresh page rather than a revival of that branch, since the docs tree moved in the meantime.

Everything here was run, not assumed

Verified against QuestDB 10.0.1 with drizzle-orm 0.45.2 and postgres 3.4.9, driving each case through the query builder:

operation result
insert works
select with where / orderBy / limit works
groupBy with aggregation works
SAMPLE BY via db.execute(sql`` ``)` works
update works
delete fails

So the page documents what the combination actually does:

  • DELETE is called out as unsupported, with a pointer to dropping a partition instead. QuestDB has no row-level delete, and db.delete(...) fails against it.
  • Migrations are out, because the table needs a designated timestamp and a partitioning strategy that drizzle-kit does not express. The page shows SQL DDL for the table and a matching Drizzle schema for querying it.
  • QuestDB SQL extensions get their own section: SAMPLE BY, LATEST ON and ASOF JOIN have no builder equivalent and go through db.execute().
  • The page points ingestion-heavy use at the Node.js client rather than the ORM, since that is what ILP is for.

One thing I deliberately left out: I first tested with prepare: false on the postgres client, then re-ran without it. It works either way, so the page does not mention it rather than carrying a setting nobody needs.

Uses the trades table throughout, which is the alignment @nwoolmer asked for on the original PR.

Registered in integrations/overview.md under Other Tools and in sidebars.js next to SQLAlchemy. All seven internal links in the page resolve to existing files.

Closes questdb#70. Picks up where questdb#71 stopped: that PR had the maintainer's
go-ahead and only needed the example aligned to the trades table, but it
went stale and was closed six months later without landing.

Everything documented here was run against QuestDB 10.0.1 with
drizzle-orm 0.45.2 and postgres 3.4.9, so the page states what the
combination actually does rather than what it should do:

- insert, select with where/orderBy/limit, and groupBy aggregation all
  work through the query builder
- SAMPLE BY has no builder equivalent and goes through db.execute(sql``)
- DELETE fails, since QuestDB has no row-level delete; the page points at
  dropping a partition instead
- migrations are out, because the table needs a designated timestamp and
  partitioning that drizzle-kit does not express

Uses the trades table throughout, matching the other client and
integration pages.
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