Add Drizzle ORM integration page - #546
Open
PasinduOshada wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
drizzle-kitemits DDL QuestDB does not implement.Senderexample rather than row-by-rowINSERT.SAMPLE BY,LATEST ONandASOF JOINhave no query-builder equivalent, so the page showsdb.execute(sql\...`)` with bound parameters.SYMBOL→text()case that has no obvious answer.Limitations section
Called out explicitly, since these are the things that will otherwise turn into issues: no
drizzle-kitmigrations, noDELETEstatement, no primary or foreign keys (and therefore no relational query API), and limited transaction semantics.Notes
connect/clients/nodejs.md(Sender.fromConfig,.at(timestamp, "ms")) and DML claims against the SQL reference — there is nodelete.md, andconcepts/designated-timestamp.mdstates the designated timestamp is not a primary key.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.