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

Add implicit sqlite rowid columns to print-schema output #3926

Merged

Conversation

longsleep
Copy link
Contributor

Whenever sqlite uses an implicit rowid it also need to be added as column to the corresponding schema. This change fixes the implicit primary key generator added in #3680 which was never tested as the test added in this pull request never actually is run.

This change enables the test and enhances the schema printer to generate the missing column if the primary key is an implicit rowid column.

Related: #2149

@longsleep longsleep force-pushed the longsleep-sqlite-fix-implicit-rowid branch from 11d4b4f to e502cbb Compare February 6, 2024 15:23
Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, for the fast fix 👍

This looks fine beside that minor thing with making rowid columns not nullable. (That will likely require updating the generated schema.rs file)

diesel_cli/src/infer_schema_internals/sqlite.rs Outdated Show resolved Hide resolved
@longsleep longsleep force-pushed the longsleep-sqlite-fix-implicit-rowid branch from e502cbb to 03c4fad Compare February 8, 2024 09:29
@weiznich
Copy link
Member

weiznich commented Feb 8, 2024

Can you rebase the branch to pull in the latest changes (to fix the CI)?

@longsleep longsleep force-pushed the longsleep-sqlite-fix-implicit-rowid branch from 03c4fad to b7803b6 Compare February 8, 2024 14:16
@longsleep
Copy link
Contributor Author

Can you rebase the branch to pull in the latest changes (to fix the CI)?

I have debased but the tests still fail with errors imo unrelated to the actual change. What needs to happen to get this merged?

@weiznich
Copy link
Member

weiznich commented Feb 9, 2024

Seems like we have hit exactly that time window where a new stable rustc version dropped. That usually means that new lints fire off and cause issues. If you don't mind you can push a change that fixes that, otherwise I will try to take care of that later today.
(There is yet another issue in the nightly released today, so yet another build will fail for now :()

@weiznich
Copy link
Member

Can you rebase the PR again to pull in the fixes for the CI?

Whenever sqlite uses an implicit rowid it also need to be added as
column to the corresponding schema. This change fixes the implicit
primary key generator added in diesel-rs#3680 which was never tested as the test
added in this pull request never actually is run.

This change enables the test and enhances the schema printer to generate
the missing column if the primary key is an implicit rowid column.

Related: diesel-rs#2149
auto-merge was automatically disabled February 20, 2024 08:29

Head branch was pushed to by a user without write access

@longsleep longsleep force-pushed the longsleep-sqlite-fix-implicit-rowid branch from b7803b6 to 8c4fa4a Compare February 20, 2024 08:29
@weiznich weiznich added this pull request to the merge queue Feb 20, 2024
Merged via the queue into diesel-rs:master with commit 51c02d4 Feb 20, 2024
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants