Skip to content
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

SQLite INTEGER PRIMARY KEY does not create Generated type for column #105

Open
torte opened this issue Oct 8, 2023 · 0 comments
Open

SQLite INTEGER PRIMARY KEY does not create Generated type for column #105

torte opened this issue Oct 8, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@torte
Copy link

torte commented Oct 8, 2023

When defining a table column with INTEGER PRIMARY KEY in SQLite, it is an alias for the interal rowid which basically is auto-generated each time a new row is inserted. When using kysely codegen with a defined sqlite column in a table like this, it will instead just generate the plain type (in this case number). I have to explicitly use the AUTOINCREMENT keyword in my table definition for the primary key and then the code will be generated correctly. That being said, autoincrement should not be used for reasons of being a bit more resource intensive (at least not for primary keys). I can provide examples if needed.

Otherwise, thank you for the great tool. Really love it saved me so much time already.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@RobinBlomberg RobinBlomberg added the bug Something isn't working label Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants