-
-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: SQLite does not support BigInt as an integer type #611
Comments
Yes the docs are incorrect. One thing to note is my PR (#558) that adds A consequence of this decision is that queries using operators like Would love to hear your feedback on this implementation. |
@MrRahulRamkumar why was blob chosen over integer, as SQLite offers 8-byte integers? using as blob makes it hard to query |
@GustavoOS If you want to store values that would not fit into an 8 byte integer you would use the If your values can be stored in an 8-byte integer you can just use an integer column like so:
|
But this would be mapped into a JS number type, which is a double-precision floating-point (loses information). As SQLite offers 8-byte integers, shouldn't they be mapped into bigints? It really seems like 8 byte integers are the same as having a bigint type. |
@GustavoOS Yes I see your point now, somebody else has also submitted a feature request in #1980. I will try and create a PR soon. |
The main reason for this should be classified as bug is because a BLOB type cannot be queried. Meaning that you cant have a |
What version of
drizzle-orm
are you using?master
What version of
drizzle-kit
are you using?master
Describe the Bug
Even tough
bigint
is listed as a supported integer mode insqlite-core/README.md
drizzle-orm/drizzle-orm/src/sqlite-core/README.md
Line 223 in 474f1a3
The code/type does not actually list
bigint
drizzle-orm/drizzle-orm/src/sqlite-core/columns/integer.ts
Lines 152 to 156 in 474f1a3
It seems like an omission that resulted from copy-pasting from README's of Postgres/MySQL. I don't see why SQLite shouldn't support bigint as an integer type.
Expected behavior
SQLite supports
bigint
as an integer typeEnvironment & setup
master branch
The text was updated successfully, but these errors were encountered: