Migrate to SQLDelight - #20
Draft
antweb wants to merge 43 commits into
Draft
Conversation
antweb
force-pushed
the
sqldelight
branch
2 times, most recently
from
September 8, 2025 10:03
5f8fd09 to
21c99b0
Compare
Updates the libpretixsync dependency to use the new SQLDelight version and switches the tests over to run against a Postgres instance instead of a temporary SQLite DB. This is required since there is no proper support for mixing database dialects in SQLDelight yet. As the server runs against Postgres, the easiest way to deal with this is to run the tests with Postgres as well.
Since the tests now run against a Postgres database and the tables are not explicitly dropped and the sequences are not reset between test runs, it is no longer safe to make assumptions about local IDs.
This allows us to have proper typing between the code that build the requests and the one that parses them.
It is now part of the schema and create through Schema.create().
SQLDelight 2.1.0 added a stricter check for reference cycles in CREATE statements which now prevents us from setting up addon_to with a foreign key constraint in the sq file. Instead Postgres implementations must now run `ALTER TABLE ReceiptLine ADD CONSTRAINT` from code when a new schema is created.
Member
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.