Skip to content

Releases: cashapp/sqldelight

Version 2.0.0-alpha02 (2022-04-12)

13 Apr 20:22
Compare
Choose a tag to compare

Added

  • [Compiler] Support returning at the end of a grouped statement
  • [Compiler] Support compiler extensions via dialect modules and add a SQLite JSON extension (#1379, #2087)
  • [Compiler] Support PRAGMA statements which return a value (#1106)
  • [Compiler] Support generating value types for marked columns
  • [Compiler] Add support for optimistic locks and validation (#1952)
  • [Compiler] Support multi-update statements
  • [PostgreSQL] Support postgres returning statements
  • [PostgreSQL] Support postgres date types
  • [PostgreSQL] Support pg intervals
  • [PostgreSQL] Support PG Booleans and fix inserts on alter tables
  • [PostgreSQL] Support optional limits in Postgres
  • [PostgreSQL] Support PG BYTEA type
  • [PostgreSQL] Add a test for postgres serials
  • [PostgreSQL] Support for update postgres syntax
  • [PostgreSQL] Support PostgreSQL array types
  • [PostgreSQL] Properly store/retrieve UUID types in PG
  • [PostgreSQL] Support PostgreSQL NUMERIC type (#1882)
  • [PostgreSQL] Support returning queries inside of common table expressions (#2471)
  • [PostgreSQL] Support json specific operators
  • [PostgreSQL] Add Postgres Copy (by Philip Wedemann)
  • [MySQL] Support MySQL Replace
  • [MySQL] Support NUMERIC/BigDecimal MySQL types (#2051)
  • [MySQL] Support MySQL truncate statement
  • [MySQL] Support json specific operators in Mysql (by Eliezer Graber)
  • [MySQL] Support MySql INTERVAL (#2969 by Eliezer Graber)
  • [HSQL] Add HSQL Window functionality
  • [SQLite] Don't replace equality checks for nullable parameters in a WHERE (#1490 by Eliezer Graber)
  • [SQLite] Support Sqlite 3.35 returning statements (#1490 by Eliezer Graber)
  • [SQLite] Support GENERATED clause
  • [SQLite] Add support for Sqlite 3.38 dialect (by Eliezer Graber)

Changed

  • [Compiler] Clean up generated code a bit
  • [Compiler] Forbid usage of table parameters in grouped statements (#1822)
  • [Compiler] Put grouped queries inside a transaction (#2785)
  • [Runtime] Return the updated row count from the drivers execute method
  • [Runtime] Confine SqlCursor to the critical section accessing the connection. (#2123 by Anders Ha)
  • [Gradle Plugin] Compare schema definitions for migrations (#841)
  • [PostgreSQL] Disallow double quotes for PG
  • [MySQL] Error on usage of == in MySQL (#2673)

Fixed

  • [Compiler] Same adapter type from different tables causing a compilation error in 2.0 alpha
  • [Compiler] Problem compiling upsert statement (#2791)
  • [Compiler] Query result should use tables in the select if there are multiple matches (#1874, #2313)
  • [Compiler] Support updating a view which has a INSTEAD OF trigger (#1018)
  • [Compiler] Support from and for in function names
  • [Compiler] Allow SEPARATOR keyword in function expressions
  • [Compiler] Cannot access ROWID of aliased table in ORDER BY
  • [Compiler] Aliased column name is not recognized in HAVING clause in MySQL
  • [Compiler] Erroneous 'Multiple columns found' error
  • [Compiler] Unable to set PRAGMA locking_mode = EXCLUSIVE;
  • [PostgreSQL] Postgresql rename column
  • [MySQL] UNIX_TIMESTAMP, TO_SECONDS, JSON_ARRAYAGG MySQL functions not recognized
  • [SQLite] fix SQLite window functionality
  • [IDE Plugin] Run the goto handler in an empty progress indicator (#2990)
  • [IDE Plugin] Ensure the highlight visitor doesnt run if the project isnt configured (#2981, #2976)
  • [IDE Plugin] Ensure transitive generated code is also updated in the IDE (#1837)
  • [IDE Plugin] Invalidate indexes when updating the dialect

Version 2.0.0-alpha01 (2022-03-31)

01 Apr 00:53
Compare
Choose a tag to compare

Change Log

[2.0.0-alpha01] - 2022-03-31

This is the first alpha release for 2.0 and has some breaking changes. We expect more ABI breaking changes to come so don't publish any libraries with dependencies on this release (applications should be fine).

Breaking Changes

  • You'll need to replace all occurrences of com.squareup.sqldelight with app.cash.sqldelight
  • The IDE plugin must be updated to a 2.X version, which can be found in the alpha or eap channel
  • Dialects are now dependencies which you can specify within gradle:
sqldelight {
  MyDatabase {
    package = "com.example"
    dialect = "app.cash.sqldelight:mysql-dialect:2.0.0-alpha01"
  }
}

The currently supported dialects are mysql-dialect, postgresql-dialect, hsql-dialect, sqlite-3-18-dialect, sqlite-3-24-dialect, sqlite-3-25-dialect, sqlite-3-30-dialect, and sqlite-3-35-dialect

  • Primitive types must now be imported (for example INTEGER AS Boolean you have to import kotlin.Boolean), some previously supported types now need an adapter. Primitive adapters are available in app.cash.sqldelight:primitive-adapters:2.0.0-alpha01 for most conversions (like IntColumnAdapter for doing Integer AS kotlin.Int).

Added

Changed

  • [Everything] Package name has changed from com.squareup.sqldelight to app.cash.sqldelight.
  • [Runtime] Move dialects into their own isolated gradle modules
  • [Runtime] Switch to driver-implemented query notifications.
  • [Runtime] Extract default column adapters to separate module (#2056, #2060)
  • [Compiler] Let modules generate the queries implementations instead of redoing it in each module
  • [Compiler] Remove the custom toString generation of generated data classes. (by Paul Woitaschek)
  • [JS Driver] Remove sql.js dependency from sqljs-driver (by Derek Ellis)
  • [Paging] Remove the android paging 2 extension
  • [IDE Plugin] Add an editor banner while SQLDelight is syncing (#2511)
  • [IDE Plugin] Minimum supported IntelliJ version is 2021.1

Fixed

  • [Runtime] Flatten listener list to reduce allocations and pointer chasing. (by Anders Ha)
  • [IDE Plugin] Fix error message to allow jumping to error (by Philip Wedemann)
  • [IDE Plugin] Add missing inspection descriptions (#2768 by Alexander Perfilyev)
  • [IDE Plugin] Fix exception in GotoDeclarationHandler (#2531, #2688, #2804 by Alexander Perfilyev)
  • [IDE Plugin] Highlight import keyword (by Alexander Perfilyev)
  • [IDE Plugin] Fix unresolved kotlin types (#1678 by Alexander Perfilyev)
  • [IDE Plugin] Fix highlighting for unresolved package (#2543 by Alexander Perfilyev)
  • [IDE Plugin] Dont attempt to inspect mismatched columns if the project index is not yet initialized
  • [IDE Plugin] Dont initialize the file index until a gradle sync has occurred
  • [IDE Plugin] Cancel the SQLDelight import if a gradle sync begins
  • [IDE Plugin] Regenerate the database outside of the thread an undo action is performed on
  • [IDE Plugin] If a reference cannot be resolves use a blank java type
  • [IDE Plugin] Correctly move off the main thread during file parsing and only move back on to write
  • [IDE Plugin] Improve compatibility with older IntelliJ versions (by Matthew Haughton)
  • [IDE Plugin] Use faster annotation API
  • [Gradle Plugin] Explicitly support js/android plugins when adding runtime (by Zac Sweers)
  • [Gradle Plugin] Register migration output task without derviving schemas from migrations (#2744 by Kevin Cianfarini)
  • [Gradle Plugin] If the migration task crashes, print the file it crashed running
  • [Gradle Plugin] Sort files when generating code to ensure idempotent outputs (by Zac Sweers)
  • [Compiler] Use faster APIs for iterating files and dont explore the entire PSI graph
  • [Compiler] Add keyword mangling to select function parameters (#2759 by Alexander Perfilyev)
  • [Compiler] Fix packageName for migration adapter (by Philip Wedemann)
  • [Compiler] Emit annotations on properties instead of types (#2798 by Alexander Perfilyev)
  • [Compiler] Sort arguments before passing to a Query subtype (#2379 by Alexander Perfilyev)

Version 1.5.3 (2021-11-23)

23 Nov 22:27
Compare
Choose a tag to compare

Added

  • [JDBC Driver] Open JdbcDriver for 3rd party driver implementations (#2672 by Philip Wedemann)
  • [MySQL Dialect] Add missing functions for time increments (#2671 by Sam Doward)
  • [Coroutines Extension] Add M1 targets for coroutines-extensions (by Philip Dukhov)

Changed

  • [Paging3 Extension] Distribute sqldelight-android-paging3 as JAR instead of AAR (#2634 by Marco Romano)
  • Exposed columns named value will be exposed as value_

Fixed

  • [Compiler] Don't extract variables for duplicate array parameters (by Alexander Perfilyev)
  • [Gradle Plugin] add kotlin.mpp.enableCompatibilityMetadataVariant. (#2628 by Martin Bonnin)
  • [IDE Plugin] Find usages processing requires a read action

Version 1.5.2 (2021-10-12)

12 Oct 17:08
Compare
Choose a tag to compare

Added

  • [Gradle Plugin] HMPP support (#2548 by Martin Bonnin)
  • [IDE Plugin] Sqlite keyword completion(by Alexander Perfilyev)
  • [IDE Plugin] Add NULL comparison inspection (by Alexander Perfilyev)
  • [IDE Plugin] Add inspection suppressor (#2519 by Alexander Perfilyev)
  • [IDE Plugin] Mixed named and positional parameters inspection (by Alexander Perfilyev)
  • [SQLite Driver] Add mingwX86 target. (#2558 by Nikita Kozhemyakin)
  • [SQLite Driver] Add M1 targets
  • [SQLite Driver] Add linuxX64 support (#2456 by Cedric Hippmann)
  • [MySQL Dialect] Add ROW_COUNT function to mysql (#2523)
  • [PostgreSQL Dialect] postgres rename, drop column (by Juan Liska)
  • [PostgreSQL Dialect] PostgreSQL grammar doesn't recognize CITEXT
  • [PostgreSQL Dialect] Include TIMESTAMP WITH TIME ZONE and TIMESTAMPTZ
  • [PostgreSQL Dialect] Add grammar for PostgreSQL GENERATED columns
  • [Runtime] Provide SqlDriver as a parameter to AfterVersion (#2534, 2614 by Ahmed El-Helw)

Changed

  • [Gradle Plugin] explicitely require Gradle 7.0 (#2572 by Martin Bonnin)
  • [Gradle Plugin] Make VerifyMigrationTask support Gradle's up-to-date checks (#2533 by Matthew Haughton)
  • [IDE Plugin] Don't warn with "Join compares two columns of different types" when joining nullable with non-nullable type (#2550 by Piotr Chmielowski)
  • [IDE Plugin] Clarify the error for the lowercase 'as' in column type (by Alexander Perfilyev)

Fixed

  • [IDE Plugin] Do not reparse under a new dialect if the project is already disposed (#2609)
  • [IDE Plugin] If the associated virtual file is null, the module is null (#2607)
  • [IDE Plugin] Avoid crashing during the unused query inspection (#2610)
  • [IDE Plugin] Run the database sync write inside of a write action (#2605)
  • [IDE Plugin] Let the IDE schedule SQLDelight syncronization
  • [IDE Plugin] Fix npe in JavaTypeMixin (#2603 by Alexander Perfilyev)
  • [IDE Plugin] Fix IndexOutOfBoundsException in MismatchJoinColumnInspection (#2602 by Alexander Perfilyev)
  • [IDE Plugin] Add description for UnusedColumnInspection (#2600 by Alexander Perfilyev)
  • [IDE Plugin] Wrap PsiElement.generatedVirtualFiles into read action (#2599 by Alexander Perfilyev)
  • [IDE Plugin] Remove unnecessary nonnull cast (#2596)
  • [IDE Plugin] Properly handle nulls for find usages (#2595)
  • [IDE Plugin] Fix IDE autocomplete for generated files for Android (#2573 by Martin Bonnin)
  • [IDE Plugin] Fix npe in SqlDelightGotoDeclarationHandler (by Alexander Perfilyev)
  • [IDE Plugin] Mangle kotlin keywords in arguments inside insert stmt (#2433 by Alexander Perfilyev)
  • [IDE Plugin] Fix npe in SqlDelightFoldingBuilder (#2382 by Alexander Perfilyev)
  • [IDE Plugin] Catch ClassCastException in CopyPasteProcessor (#2369 by Alexander Perfilyev)
  • [IDE Plugin] Fix update live template (by Ilias Redissi)
  • [IDE Plugin] Adds descriptions to intention actions (#2489 by Alexander Perfilyev)
  • [IDE Plugin] Fix exception in CreateTriggerMixin if table is not found (by Alexander Perfilyev)
  • [Compiler] Topologically sort table creation statemenets
  • [Compiler] Stop invoking forDatabaseFiles callback on directories (#2532)
  • [Gradle Plugin] Propagate generateDatabaseInterface task dependency to potential consumers (#2518 by Martin Bonnin)

Version 1.5.1 (2021-07-16)

16 Jul 20:18
Compare
Choose a tag to compare

Added

Changed

  • [Native Driver] Improve native transaction performance by avoiding freezing and shareable data structures when possible (by Anders Ha)
  • [Paging 3] Bump Paging3 version to 3.0.0 stable
  • [JS Driver] Upgrade sql.js to 1.5.0

Fixed

Version 1.5.0 (2021-04-23)

23 Apr 22:23
Compare
Choose a tag to compare

Added

Changed

  • [Compiler] Smart cast "IS NOT NULL" queries (#867)
  • [Compiler] Protect against keywords that will fail at runtime (#1471, #1629)
  • [Gradle Plugin] Reduce size of gradle plugin from 60mb -> 13mb.
  • [Gradle Plugin] Properly support android variants, and remove support for KMM target-specific sql (#1039)
  • [Gradle Plugin] Pick a minimum sqlite version based on minsdk (#1684)
  • [Native Driver] Native driver connection pool and performance updates

Fixed

  • [Compiler] NBSP before lambdas (by Benoît Quenaudon)
  • [Compiler] Fix incompatible types in generated bind* and cursor.get* statements
  • [Compiler] SQL clause should persist adapted type (#2067)
  • [Compiler] Column with only NULL keyword should be nullable
  • [Compiler] Dont generate mapper lambda with type annotations (#1957)
  • [Compiler] If custom queries would clash, use the file name as an additional package suffix (#1057, #1278)
  • [Compiler] Ensure foreign key cascades cause query listeners to be notified (#1325, #1485)
  • [Compiler] If unioning two of the same type, return the table type (#1342)
  • [Compiler] Ensure params to ifnull and coalesce can be nullable (#1263)
  • [Compiler] Correctly use query-imposed nullability for expressions
  • [MySQL Dialect] Support MySQL if statements
  • [PostgreSQL Dialect] Retrieve NUMERIC and DECIMAL as Double in PostgreSQL (#2118)
  • [SQLite Dialect] UPSERT notifications should account for BEFORE/AFTER UPDATE triggers. (#2198 by Anders Ha)
  • [SQLite Driver] Use multiple connections for threads in the SqliteDriver unless we are in memory (#1832)
  • [JDBC Driver] JDBC Driver assumes autoCommit is true (#2041)
  • [JDBC Driver] Ensure that we close connections on exception (#2306)
  • [IDE Plugin] Fix GoToDeclaration/FindUsages being broken on Windows due to path separator bug (#2054 by Angus Holder)
  • [IDE Plugin] Ignore gradle errors instead of crashing in the IDE.
  • [IDE Plugin] If a sqldelight file is moved to a non-sqldelight module, do not attempt codegen
  • [IDE Plugin] Ignore codegen errors in IDE
  • [IDE Plugin] Ensure that we dont try to negatively substring (#2068)
  • [IDE Plugin] Also ensure project is not disposed before running gradle action (#2155)
  • [IDE Plugin] Arithmetic on nullable types should also be nullable (#1853)
  • [IDE Plugin] Make 'expand * intention' work with additional projections (#2173 by Alexander Perfilyev)
  • [IDE Plugin] If kotlin resolution fails during GoTo, dont attempt to go to sqldelight files
  • [IDE Plugin] If IntelliJ encounters an exception while sqldelight is indexing, dont crash
  • [IDE Plugin] Handle exceptions that happen while detecting errors before codegen in the IDE
  • [IDE Plugin] Make the IDE plugin compatible with Dynamic Plugins (#1536)
  • [Gradle Plugin] Race condition generating a database using WorkerApi (#2062 by Stéphane Nicolas)
  • [Gradle Plugin] classLoaderIsolation prevents custom jdbc usage (#2048 by Ben Asher)
  • [Gradle Plugin] Improve missing packageName error message (by Niklas Baudy)
  • [Gradle Plugin] SQLDelight bleeds IntelliJ dependencies onto buildscript class path (#1998)
  • [Gradle Plugin] Fix gradle build caching (#2075)
  • [Gradle Plugin] Do not depend on kotlin-native-utils in Gradle plugin (by Ilya Matveev)
  • [Gradle Plugin] Also write the database if there are only migration files (#2094)
  • [Gradle Plugin] Ensure diamond dependencies only get picked up once in the final compilation unit (#1455)

Also just a general shoutout to Matthew Haughton who did a lot of work to improve the SQLDelight infrastructure this release.

Version 1.4.4 (2020-10-08)

08 Oct 20:05
Compare
Choose a tag to compare

Added

  • [PostgreSQL Dialect] Support data-modifying statements in WITH
  • [PostgreSQL Dialect] Support substring function
  • [Gradle Plugin] Added verifyMigrations flag for validating migrations during SQLDelight compilation (#1872)

Changed

  • [Compiler] Flag SQLite specific functions as unknown in non-SQLite dialects
  • [Gradle Plugin] Provide a warning when the sqldelight plugin is applied but no databases are configured (#1421)

Fixed

  • [Compiler] Report an error when binding a column name in an ORDER BY clause (#1187 by Eliezer Graber)
  • [Compiler] Registry warnings appear when generating the db interface (#1792)
  • [Compiler] Incorrect type inference for case statement (#1811)
  • [Compiler] Provide better errors for migration files with no version (#2006)
  • [Compiler] Required database type to marshal is incorrect for some database type ColumnAdapter's (#2012)
  • [Compiler] Nullability of CAST (#1261)
  • [Compiler] Lots of name shadowed warnings in query wrappers (#1946 by Eliezer Graber)
  • [Compiler] Generated code is using full qualifier names (#1939)
  • [IDE Plugin] Trigger sqldelight code gen from gradle syncs
  • [IDE Plugin] Plugin not regenerating database interface when changing .sq files (#1945)
  • [IDE Plugin] Issue when moving files to new packages (#444)
  • [IDE Plugin] If theres nowhere to move the cursor, do nothing instead of crashing (#1994)
  • [IDE Plugin] Use empty package name for files outside of a gradle project (#1973)
  • [IDE Plugin] Fail gracefully for invalid types (#1943)
  • [IDE Plugin] Throw a better error message when encountering an unknown expression (#1958)
  • [Gradle Plugin] SQLDelight bleeds IntelliJ dependencies onto buildscript class path (#1998)
  • [Gradle Plugin] "JavadocIntegrationKt not found" compilation error when adding method doc in *.sq file (#1982)
  • [Gradle Plugin] SqlDeslight gradle plugin doesn't support Configuration Caching (CoCa). (#1947 by Stéphane Nicolas)
  • [SQLite JDBC Driver] SQLException: database in auto-commit mode (#1832)
  • [Coroutines Extension] Fix IR backend for coroutines-extensions (#1918 by Derek Ellis)

Version 1.4.3 (2020-09-04)

04 Sep 17:22
Compare
Choose a tag to compare

Added

Fixed

  • [MySQL Dialect] Treat MySQL AUTO_INCREMENT as having a default value (#1823)
  • [Compiler] Fix Upsert statement compiler error (#1809 by Eliezer Graber)
  • [Compiler] Fix issue with invalid Kotlin being generated (#1925 by Eliezer Grabar)
  • [Compiler] Have a better error message for unknown functions (#1843)
  • [Compiler] Expose string as the type for the second parameter of instr
  • [IDE Plugin] Fix daemon bloat and UI thread stalling for IDE plugin (#1916)
  • [IDE Plugin] Handle null module scenario (#1902)
  • [IDE Plugin] In unconfigured sq files return empty string for the package name (#1920)
  • [IDE Plugin] Fix grouped statements and add an integration test for them (#1820)
  • [IDE Plugin] Use built in ModuleUtil to find the module for an element (#1854)
  • [IDE Plugin] Only add valid elements to lookups (#1909)
  • [IDE Plugin] Parent can be null (#1857)

Version 1.4.2 - 2020-08-27

28 Aug 01:39
Compare
Choose a tag to compare

Added

  • [Runtime] Support new JS IR backend
  • [Gradle Plugin] Add generateSqlDelightInterface Gradle task. (by Niklas Baudy)
  • [Gradle Plugin] Add verifySqlDelightMigration Gradle task. (by Niklas Baudy)

Fixed

  • [IDE Plugin] Use the gradle tooling API to facilitate data sharing between the IDE and gradle
  • [IDE Plugin] Default to false for schema derivation
  • [IDE Plugin] Properly retrieve the commonMain source set
  • [MySQL Dialect] Added minute to mySqlFunctionType() (by MaaxGr)

Version 1.4.1 (2020-08-21)

22 Aug 02:33
Compare
Choose a tag to compare

Added

  • [Runtime] Support Kotlin 1.4.0 (#1859)

Changed

  • [Gradle Plugin] Make AGP dependency compileOnly (#1362)

Fixed

  • [Compiler] Add optional javadoc to column defintion rule and to table interface generator (#1224 by Daniel Eke)
  • [SQLite Dialect] Add support for sqlite fts5 auxiliary functions highlight, snippet, and bm25 (by Daniel Rampelt)
  • [MySQL Dialect] Support MySQL bit data type
  • [MySQL Dialect] Support MySQL binary literals
  • [PostgreSQL Dialect] Expose SERIAL from sql-psi (by Veyndan Stuart)
  • [PostgreSQL Dialect] Add BOOLEAN data type (by Veyndan Stuart)
  • [PostgreSQL Dialect] Add NULL column constraint (by Veyndan Stuart)
  • [HSQL Dialect] Adds AUTO_INCREMENT support to HSQL (by Ryan Harter)