-
Notifications
You must be signed in to change notification settings - Fork 127
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] PrimaryKey with AUTOINCREMENT not recognized #802
Comments
That's true, nice catch mate! The code on this line explains that, and now you give me problem. :) |
Ah well done! |
The problem with SQLite is the fact that there is no sys tables that maintain these definitions, and that, we need to manually extract the identity column from the actual literal string schema extracted from the database. Anyway, I should expect that putting an For now, please use the "ColumnName Type AUTOINCREMENT" approach until the issue on the other schema implementation is rectified. Is that okay? |
Yes, as a workaround I created the table in another way. |
Thanks! This kind of issue is up for grabs as well, I guess, the changes to this issue are very limited, so it is safe for a PR. Please let me know if you wish to contribute 👍🏼 😉 |
Sorry, at the moment I'm too busy to contribute. |
No worries, we can always issue the fix for you soon. |
Naaaaaa, don't worry. if there is a workaround, there is no rush to fix it :) |
The fix has been introduced and it will be available on the next release. Please do let me know if you need a beta release for this. |
Well done! For me is not needed a beta. I will wait next stable release. |
Bug Description
Hello. With a table created with DBSqlite Browser, after adding a primary key, with or without autoincrement, if the AUTOINCREMENT "specialword" is added on the column, RepoDB recognize the key as a primary key with autoincrement and skip filling the query with ID field.
Instead, with PRIMARY KEY added in the end of table (for example when you have multiple fields for primary key or with default creation of table with DBSqliteBrowser), RepoDb fill the ID with a value (0 for example, because the key is a not null integer, but it will be not valorized), then you get an exception regard duplicate keys.
Exception Message:
Schema and Model:
Library Version:
Example: RepoDb v1.12.7 and RepoDb.Sqlite
With that schema it works perfectly
The text was updated successfully, but these errors were encountered: