-
Notifications
You must be signed in to change notification settings - Fork 5
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
First steps to move to SQLDelight #47
base: master
Are you sure you want to change the base?
Commits on Nov 22, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2c3d7cc - Browse repository at this point
Copy the full SHA 2c3d7ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2df8dba - Browse repository at this point
Copy the full SHA 2df8dbaView commit details -
Remove nullability from downloadFile response
It returns the result of apiCall, which is non-null.
Configuration menu - View commit details
-
Copy full SHA for 189238d - Browse repository at this point
Copy the full SHA 189238dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e78758f - Browse repository at this point
Copy the full SHA e78758fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fe3894 - Browse repository at this point
Copy the full SHA 4fe3894View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1566802 - Browse repository at this point
Copy the full SHA 1566802View commit details -
Create extensions with JSON utilities
Since we no longer inherit from classes like AbstractReceipt, the JSON utils must be added separately.
Configuration menu - View commit details
-
Copy full SHA for 77cce26 - Browse repository at this point
Copy the full SHA 77cce26View commit details -
Removes the positionid of the add-on parent from the JSON and replaces it with just the addon_to ID. With SQLDelight, we can no longer directly resolve the relation with just the addon_to field, which means that we have to pass in either the ReceiptLine that addon_to points to or its positionid. Since the toJSON() is mostly used for logging purposes and the positionid is not strictly required, we can simplify the function here and add the equivalent of addon_to.positionid to the JSON afterwards in the caller where required.
Configuration menu - View commit details
-
Copy full SHA for f17afd7 - Browse repository at this point
Copy the full SHA f17afd7View commit details -
Provide the same functionality as the getters on AbstractItem, but for the SQLDelight query result.
Configuration menu - View commit details
-
Copy full SHA for b3f2a7d - Browse repository at this point
Copy the full SHA b3f2a7dView commit details -
Configuration menu - View commit details
-
Copy full SHA for bcb2d4f - Browse repository at this point
Copy the full SHA bcb2d4fView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf3bc0b - Browse repository at this point
Copy the full SHA cf3bc0bView commit details -
Enable SQLDelight database on Android
Android uses a different date format and requires the database version to be set correctly.
Configuration menu - View commit details
-
Copy full SHA for 85961f1 - Browse repository at this point
Copy the full SHA 85961f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 167da15 - Browse repository at this point
Copy the full SHA 167da15View commit details -
Configuration menu - View commit details
-
Copy full SHA for c0eec9e - Browse repository at this point
Copy the full SHA c0eec9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7c9abca - Browse repository at this point
Copy the full SHA 7c9abcaView commit details -
Change to BigDecimal.valueOf() in BigDecimalAdapter
Uses the string representation of the double to create a BigDecimal. The previously used constructor on the other hand used the exact representation, which - to quote the docs - "can be somewhat unpredictable". This behaviour is also closer to requery's handling of decimal values. See https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#BigDecimal(double)
Configuration menu - View commit details
-
Copy full SHA for 1641d25 - Browse repository at this point
Copy the full SHA 1641d25View commit details -
Configuration menu - View commit details
-
Copy full SHA for a5bda6c - Browse repository at this point
Copy the full SHA a5bda6cView commit details -
Update Closing column type mapping
Aligns the data types with those used for other tables.
Configuration menu - View commit details
-
Copy full SHA for 57b3617 - Browse repository at this point
Copy the full SHA 57b3617View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5f30d47 - Browse repository at this point
Copy the full SHA 5f30d47View commit details -
Configuration menu - View commit details
-
Copy full SHA for edd98df - Browse repository at this point
Copy the full SHA edd98dfView commit details -
Add consistent handling of dates stored as text
Some dates are stored as TEXT values in the database. Since they might contain unexpected values (such as "null"), it is more robust to handle them all through a single mapper class that performs consistent conversion.
Configuration menu - View commit details
-
Copy full SHA for 7665988 - Browse repository at this point
Copy the full SHA 7665988View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3903167 - Browse repository at this point
Copy the full SHA 3903167View commit details -
Fix Postgres/SQLite incompatibilities
Maps all 4 byte Postgres ID columns to Long in order to be consistent with the remaining code. See PostgresIdAdapter. Moves getLastInsertedId queries to separate compat .sq file to fix conflicting query classes being generated. The .sq files under sqlite/ and postgres/ are only allowed to contain the CREATE TABLE statements. Otherwise they generate another query class that conflicts with the ones defined in common/. The solution is to create a .sq file with a different name so that it generates a query class with a different name (such as compat.sq for CompatQueries).
Configuration menu - View commit details
-
Copy full SHA for 5bdff02 - Browse repository at this point
Copy the full SHA 5bdff02View commit details -
Configuration menu - View commit details
-
Copy full SHA for c47c06a - Browse repository at this point
Copy the full SHA c47c06aView commit details -
Define foreign keys as column constraints instead of table constraints
SQLDelight has a machanism to sort create statements for a schema based on their dependencies. To achieve this, it creates a graph and sorts it topologically. During this process it only considers column level constraints. If a foreign key is defined as a table level constraint, the dependency is not considered. We were using table level constraints until now which resulted in create statements that were sorted alphabetically after file names. Since the .sq file names match their table names, calls to Schema.create() would fail on BadgeLayoutItem, which requires the table Item to exist.
Configuration menu - View commit details
-
Copy full SHA for b350d6d - Browse repository at this point
Copy the full SHA b350d6dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 64539aa - Browse repository at this point
Copy the full SHA 64539aaView commit details -
Move BaseDatabaseTest out of testFixtures
This class now creates build problems when used in a Postgres project.
Configuration menu - View commit details
-
Copy full SHA for a3f56d1 - Browse repository at this point
Copy the full SHA a3f56d1View commit details -
Add remaining table definitions
Now that the schema might be created by SQLDelight, all tables must be defined.
Configuration menu - View commit details
-
Copy full SHA for 0a7bb86 - Browse repository at this point
Copy the full SHA 0a7bb86View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3fa0c91 - Browse repository at this point
Copy the full SHA 3fa0c91View commit details -
Configuration menu - View commit details
-
Copy full SHA for c8b94b9 - Browse repository at this point
Copy the full SHA c8b94b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6fa69d8 - Browse repository at this point
Copy the full SHA 6fa69d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for b13a3f8 - Browse repository at this point
Copy the full SHA b13a3f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 305633f - Browse repository at this point
Copy the full SHA 305633fView commit details -
Use explicit parameter names to better distinguish between columns that reference a local ID and those that reference server IDs.
Configuration menu - View commit details
-
Copy full SHA for eea9665 - Browse repository at this point
Copy the full SHA eea9665View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3423d94 - Browse repository at this point
Copy the full SHA 3423d94View commit details -
The SQLDelight Gradle plugin is causing trouble with other JREs and there is no more reason to run Gradle with older Java versions on this project.
Configuration menu - View commit details
-
Copy full SHA for 8f5bcc2 - Browse repository at this point
Copy the full SHA 8f5bcc2View commit details -
Move protobuf plugin version to settings.gradle
Fixes multi-module builds that have a top-level definition of the protobuf plugin.
Configuration menu - View commit details
-
Copy full SHA for 4c65a51 - Browse repository at this point
Copy the full SHA 4c65a51View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b3ce76 - Browse repository at this point
Copy the full SHA 1b3ce76View commit details -
Configuration menu - View commit details
-
Copy full SHA for 77f79e2 - Browse repository at this point
Copy the full SHA 77f79e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e24e29 - Browse repository at this point
Copy the full SHA 5e24e29View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c2ce78 - Browse repository at this point
Copy the full SHA 3c2ce78View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c21064 - Browse repository at this point
Copy the full SHA 0c21064View commit details -
Use ID instead of server ID for updateFromJson queries
While server IDs should work just fine, it is still safer to use the tables' primary keys to refrence existing records.
Configuration menu - View commit details
-
Copy full SHA for b213bc8 - Browse repository at this point
Copy the full SHA b213bc8View commit details -
Add back event slug filter to migrated runBatch queries
Some of the migrated sync adapters are missing the event slug filter in runBatch that was present in the original version.
Configuration menu - View commit details
-
Copy full SHA for 7997270 - Browse repository at this point
Copy the full SHA 7997270View commit details -
Configuration menu - View commit details
-
Copy full SHA for 095f070 - Browse repository at this point
Copy the full SHA 095f070View commit details -
Re-arrange SqBaseConditionalSyncAdapter method order
Improves readability and creates a better basesline for the next migrations.
Configuration menu - View commit details
-
Copy full SHA for ccfe923 - Browse repository at this point
Copy the full SHA ccfe923View commit details -
Configuration menu - View commit details
-
Copy full SHA for de3444c - Browse repository at this point
Copy the full SHA de3444cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c8ff68 - Browse repository at this point
Copy the full SHA 9c8ff68View commit details -
Configuration menu - View commit details
-
Copy full SHA for abd810a - Browse repository at this point
Copy the full SHA abd810aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3250792 - Browse repository at this point
Copy the full SHA 3250792View commit details -
Configuration menu - View commit details
-
Copy full SHA for 31981bf - Browse repository at this point
Copy the full SHA 31981bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7569a6b - Browse repository at this point
Copy the full SHA 7569a6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for a01c0ce - Browse repository at this point
Copy the full SHA a01c0ceView commit details -
Use consistent column naming on CheckInList
SQLDelight does not like case differences between SQLite and Postgres. Since Postgres converts them to lowercase anyway, it's safe to use the SQLite naming.
Configuration menu - View commit details
-
Copy full SHA for 0e0bd3c - Browse repository at this point
Copy the full SHA 0e0bd3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for dd8d194 - Browse repository at this point
Copy the full SHA dd8d194View commit details -
Add not-null assertion to columns with inconsistent nullability
The columns on CheckInList_Item and Question_Item have inconsistent definitions between Postgres and SQLite. On Postgres the are created as NOT NULL, which results in SQLDelight generating slightly different data classes between the two.
Configuration menu - View commit details
-
Copy full SHA for a5ef373 - Browse repository at this point
Copy the full SHA a5ef373View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d1922c - Browse repository at this point
Copy the full SHA 1d1922cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6848bcc - Browse repository at this point
Copy the full SHA 6848bccView commit details -
Configuration menu - View commit details
-
Copy full SHA for a2e8a20 - Browse repository at this point
Copy the full SHA a2e8a20View commit details -
Configuration menu - View commit details
-
Copy full SHA for 173f423 - Browse repository at this point
Copy the full SHA 173f423View commit details -
Configuration menu - View commit details
-
Copy full SHA for d900511 - Browse repository at this point
Copy the full SHA d900511View commit details -
Configuration menu - View commit details
-
Copy full SHA for aec2480 - Browse repository at this point
Copy the full SHA aec2480View commit details -
Convert Quota.available to Boolean on Postgres
Makes the type of this column consistent with SQLite
Configuration menu - View commit details
-
Copy full SHA for ce6e96d - Browse repository at this point
Copy the full SHA ce6e96dView commit details -
Use IllegalArgumentException for PostgresIdAdapter
It's a better fit than IllegalStateException.
Configuration menu - View commit details
-
Copy full SHA for b08027e - Browse repository at this point
Copy the full SHA b08027eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f544bf5 - Browse repository at this point
Copy the full SHA f544bf5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 472a3f7 - Browse repository at this point
Copy the full SHA 472a3f7View commit details -
Validate scale in BigDecimalAdapter
Since we apply a scale of 2 when converting column values, we should avoid storing any higher precisions numbers.
Configuration menu - View commit details
-
Copy full SHA for e2fc471 - Browse repository at this point
Copy the full SHA e2fc471View commit details -
Move toScaledBigDecimal/toScaledBigDecimalOrZero to BigDecimalAdapter
Any changes to the adapter might also affect the conversions, so it makes sense to keep them in the same file.
Configuration menu - View commit details
-
Copy full SHA for d1b297e - Browse repository at this point
Copy the full SHA d1b297eView commit details -
Configuration menu - View commit details
-
Copy full SHA for bbeba89 - Browse repository at this point
Copy the full SHA bbeba89View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2eb593e - Browse repository at this point
Copy the full SHA 2eb593eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a68913 - Browse repository at this point
Copy the full SHA 9a68913View commit details -
With removed batching and the new insert()/update() methods, autoPersist() is no longer needed.
Configuration menu - View commit details
-
Copy full SHA for d5cad8b - Browse repository at this point
Copy the full SHA d5cad8bView commit details -
Remove database version from Gradle files
SQLDelight already uses the migration files to determine the DB version.
Configuration menu - View commit details
-
Copy full SHA for 20dba52 - Browse repository at this point
Copy the full SHA 20dba52View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a4463b - Browse repository at this point
Copy the full SHA 0a4463bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e0327cc - Browse repository at this point
Copy the full SHA e0327ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 91e8e05 - Browse repository at this point
Copy the full SHA 91e8e05View commit details -
Configuration menu - View commit details
-
Copy full SHA for 09fa413 - Browse repository at this point
Copy the full SHA 09fa413View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb5c65b - Browse repository at this point
Copy the full SHA eb5c65bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d26ac2 - Browse repository at this point
Copy the full SHA 9d26ac2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 21c330a - Browse repository at this point
Copy the full SHA 21c330aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 450ce71 - Browse repository at this point
Copy the full SHA 450ce71View commit details -
Question models were missing the getDependencyValues() override.
Configuration menu - View commit details
-
Copy full SHA for f3b9cca - Browse repository at this point
Copy the full SHA f3b9ccaView commit details -
Fix java.time to Joda conversion
We were providing the wrong type of Instant.
Configuration menu - View commit details
-
Copy full SHA for 975715e - Browse repository at this point
Copy the full SHA 975715eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ad4ee6 - Browse repository at this point
Copy the full SHA 7ad4ee6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0148e06 - Browse repository at this point
Copy the full SHA 0148e06View commit details -
Configuration menu - View commit details
-
Copy full SHA for 34104f5 - Browse repository at this point
Copy the full SHA 34104f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d88158 - Browse repository at this point
Copy the full SHA 2d88158View commit details -
Migrate majority of OrderPosition in AsyncCheckProvider
Some query building code remains which should be migrated in a separate step.
Configuration menu - View commit details
-
Copy full SHA for 66d5e78 - Browse repository at this point
Copy the full SHA 66d5e78View commit details -
Configuration menu - View commit details
-
Copy full SHA for f97bb6a - Browse repository at this point
Copy the full SHA f97bb6aView commit details -
Configuration menu - View commit details
-
Copy full SHA for a514446 - Browse repository at this point
Copy the full SHA a514446View commit details -
Configuration menu - View commit details
-
Copy full SHA for e038275 - Browse repository at this point
Copy the full SHA e038275View commit details -
Fix typing issue between SQLite and Postgres
SQLDelight returns the Long value directly on Postgres while it wraps it in a result type on SQLDelight.
Configuration menu - View commit details
-
Copy full SHA for 3e2287f - Browse repository at this point
Copy the full SHA 3e2287fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 01c3fae - Browse repository at this point
Copy the full SHA 01c3faeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7abbd2d - Browse repository at this point
Copy the full SHA 7abbd2dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4937a4a - Browse repository at this point
Copy the full SHA 4937a4aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e399fd - Browse repository at this point
Copy the full SHA 2e399fdView commit details -
Configuration menu - View commit details
-
Copy full SHA for bb1cf20 - Browse repository at this point
Copy the full SHA bb1cf20View commit details -
Configuration menu - View commit details
-
Copy full SHA for 41150ea - Browse repository at this point
Copy the full SHA 41150eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 51ea1e8 - Browse repository at this point
Copy the full SHA 51ea1e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6fb7d8d - Browse repository at this point
Copy the full SHA 6fb7d8dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a7c0e29 - Browse repository at this point
Copy the full SHA a7c0e29View commit details -
Configuration menu - View commit details
-
Copy full SHA for b95c50e - Browse repository at this point
Copy the full SHA b95c50eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 52f3b3b - Browse repository at this point
Copy the full SHA 52f3b3bView commit details -
Use 0/1 for booleans in the queries, the shipped sqlite version on an…
…droid is too old for TRUE/FALSE (PRETIXPOS-1HH)
Configuration menu - View commit details
-
Copy full SHA for 9d1d180 - Browse repository at this point
Copy the full SHA 9d1d180View commit details -
Remove shared SimpleDateFormat instances in date adapters
Since SimpleDateFormat is not thread safe, we might be running into race conditions here actually. Re-creating a new instance is expensive, so this is only a temporary fix while we validate a change to DateTimeFormatter.
Configuration menu - View commit details
-
Copy full SHA for 357a01d - Browse repository at this point
Copy the full SHA 357a01dView commit details -
Use DateTimeFormatter in date adapters
Should guarantee thread safety without constantly re-creating formatters.
Configuration menu - View commit details
-
Copy full SHA for 5a444bc - Browse repository at this point
Copy the full SHA 5a444bcView commit details -
Add issue_giftcard to test Items
Reduces warnings when we convert them to models.
Configuration menu - View commit details
-
Copy full SHA for 7701aaf - Browse repository at this point
Copy the full SHA 7701aafView commit details -
Fix boolean handling under Postgres
The change in cce5bf9 fixed booleans on older SQLite versions, but broke the queries for Postgres. This is a workaround that should make both databases happy. Since Postgres is extra pedantic in CASE epxressions, the complex order position queries had to be moved to the set of dialect-specific queries.
Configuration menu - View commit details
-
Copy full SHA for 3a08d8b - Browse repository at this point
Copy the full SHA 3a08d8bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 434c9f1 - Browse repository at this point
Copy the full SHA 434c9f1View commit details -
Move query to lock QueuedOrder to compat queries
Updates with 1 instead of TRUE also don't work on Postgres.
Configuration menu - View commit details
-
Copy full SHA for eb80c46 - Browse repository at this point
Copy the full SHA eb80c46View commit details