-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use BigInt for integer primary key in sqlite for diesel-cli #3940
Use BigInt for integer primary key in sqlite for diesel-cli #3940
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this feature 👍
I generally like the idea to address the underlying issue, but I strongly suggest not to use a feature flag for this as this makes it:
- harder to discover this feature
- harder to document this feature
- harder to test this feature (another entry in the feature matrix…)
Instead I would suggest making this a config option in the diesel.toml
file and a CLI flag. This allows to control that feature at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. This looks now much closer to something that is ready to be merged. I've left a few minor comments. The most critical thing is the loading of the primary keys while checking if the column is an alias for rowid. That needs to be fixed, the other comments are more suggestions.
It would also be great to have an entry in the Changelog.md
file for this feature.
diesel_cli/tests/print_schema/print_schema_sqlite_rowid_column/sqlite/schema.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now 👍. Thanks for pushing this forward.
Fixes #852.
The
sqlite-integer-primary-key-is-bigint
config parameter is used to modify the generation.With this option, the
PRAGMA table_list
query is used to get theWITHOUT ROWID
attribute for a table (available from SQLite 3.37).