Add experimental DuckDB dialect to drift#3787
Merged
Merged
Conversation
simolus3
reviewed
Apr 27, 2026
Contributor
Author
|
Let me add one more thing. I recommend using the skill I developed to help you achieve automatic release. @simolus3 https://github.com/Hu-Wentao/wyatt_skills/tree/main/skills/publish-flutter-package |
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.
Problem
Currently,
drift_duckdbstill masquerades asSqlDialect.sqlite, causing the Drift DSL to reuse the type semantics of SQLite under DuckDB. The most straightforward issue is that bothDriftSqlType.intandDriftSqlType.bigIntuseINTEGER, while for DuckDB, 64 - bit integers should beBIGINT. This can lead to errors or sub - optimal results in the schema and cast SQL.Scope of this PR
SqlDialect.duckdbin drift core.BOOLEAN,TEXT,BIGINT,DOUBLE,BLOB.?, and prevent sqlite-style indexed placeholders such as?1.CASTandON CONFLICTSQL generation where verified to work for DuckDB.What is intentionally not covered yet
drift_duckdb.UUID,STRUCT,LIST,HUGEINT, etc.Test coverage
BIGINTforintandbigInt.BOOLEANforbool.DOUBLEfordouble.?and do not emit sqlite-style indexed placeholders.cast<int>()andcast<BigInt>()generateCAST(... AS BIGINT).RETURNING *SQL generation paths are covered.ref