SQLDelight v2.0.0-alpha04 Release Notes
Release Date: 2022-10-03 // almost 2 years ago-
๐ฅ Breaking Changes
- The Paging 3 extension API has changed to only allow int types for the count.
- 0๏ธโฃ The coroutines extension now requires a dispatcher to be passed in instead of defaulting.
- Dialect and Driver classes are final, use delegation instead.
โ Added
- 0๏ธโฃ [HSQL Dialect] Hsql: Support using DEFAULT for generated columns in Insert (#3372 by [Philip Wedemann][hfhbd])
- 0๏ธโฃ [PostgreSQL Dialect] PostgreSQL: Support using DEFAULT for generated columns in INSERT (#3373 by [Philip Wedemann][hfhbd])
- [PostgreSQL Dialect] Add NOW() to PostgreSQL (#3403 by [Philip Wedemann][hfhbd])
- [PostgreSQL Dialect] PostgreSQL Add NOT operator (#3504 by [Philip Wedemann][hfhbd])
- [Paging] Allow passing in CoroutineContext to *QueryPagingSource (#3384)
- ๐ [Gradle Plugin] Add better version catalog support for dialects (#3435)
- [Native Driver] Add callback to hook into DatabaseConfiguration creation of NativeSqliteDriver (#3512 by [Sven Jacobs][svenjacobs])
๐ Changed
- 0๏ธโฃ [Paging] Add a default dispatcher to the KeyedQueryPagingSource backed QueryPagingSource function (#3385)
- [Paging] Make OffsetQueryPagingSource only work with Int (#3386)
- ๐ [Async Runtime] Move await* to upper class ExecutableQuery (#3524 by [Philip Wedemann][hfhbd])
- ๐ [Coroutines Extensions] Remove default params to flow extensions (#3489)
๐ Fixed
- โก๏ธ [Gradle Plugin] Update to Kotlin 1.7.20 (#3542 by [Zac Sweers][zacsweers])
- [R2DBC Driver] Adopt R2DBC changes which do not always send a value (#3525 by [Philip Wedemann][hfhbd])
- [HSQL Dialect] Fix failing sqlite VerifyMigrationTask with Hsql (#3380 by [Philip Wedemann][hfhbd])
- ๐ง [Gradle Plugin] Convert tasks to use lazy configuration API (by [Matthew Haughton][3flex])
- ๐ [Gradle Plugin] Avoid NPEs in Kotlin 1.7.20 (#3398 by [Zac Sweers][ZacSweers])
- ๐ [Gradle Plugin] Fix description of squash migrations task (#3449)
- ๐ [IDE Plugin] Fix NoSuchFieldError in newer Kotlin plugins (#3422 by [Madis Pink][madisp])
- ๐ [IDE Plugin] IDEA: UnusedQueryInspection - fix ArrayIndexOutOfBoundsException. (#3427 by [Niklas Baudy][vanniktech])
- ๐ [IDE Plugin] Use reflection for old kotlin plugin references
- [Compiler] Custom dialect with extension function don't create imports (#3338 by [Philip Wedemann][hfhbd])
- [Compiler] Fix escaping CodeBlock.of("${CodeBlock.toString()}") (#3340 by [Philip Wedemann][hfhbd])
- [Compiler] Await async execute statements in migrations (#3352)
- [Compiler] Fix AS (#3370 by [Philip Wedemann][hfhbd])
- ๐ [Compiler]
getObject
method supports automatic filling of the actual type. (#3401 by [Rob X][robx]) - [Compiler] Fix codegen for async grouped returning statements (#3411)
- ๐ [Compiler] Infer the Kotlin type of bind parameter, if possible, or fail with a better error message (#3413 by [Philip Wedemann][hfhbd])
- [Compiler] Don't allow ABS("foo") (#3430 by [Philip Wedemann][hfhbd])
- ๐ [Compiler] Support inferring kotlin type from other parameters (#3431 by [Philip Wedemann][hfhbd])
- [Compiler] Always create the database implementation (#3540 by [Philip Wedemann][hfhbd])
- [Compiler] Relax javaDoc and add it to custom mapper function too (#3554 [Philip Wedemann][hfhbd])
- 0๏ธโฃ [Compiler] Fix DEFAULT in binding (by [Philip Wedemann][hfhbd])
- [Paging] Fix Paging 3 (#3396)
- [Paging] Allow construction of OffsetQueryPagingSource with Long (#3409)
- [Paging] Don't statically swap Dispatchers.Main (#3428)
Previous changes from v2.0.0-alpha03
-
๐ฅ Breaking Changes
- Dialects are now references like actual gradle dependencies.
groovy sqldelight { MyDatabase { dialect("app.cash.sqldelight:postgres-dialect:2.0.0-alpha03") } }
- ๐ The
AfterVersionWithDriver
type was removed in favour ofAfterVersion
which now always has the driver. - The
Schema
type is no longer a subtype ofSqlDriver
PreparedStatement
APIs are now called with zero-based indexes.
โ Added
- ๐ [IDE Plugin] Added support for running SQLite, MySQL, and PostgreSQL commands against a running database (#2718 by [Alexander Perfilyev][aperfilyev])
- ๐ [IDE Plugin] Add support for the android studio DB inspector (#3107 by [Alexander Perfilyev][aperfilyev])
- ๐ [Runtime] Add support for async drivers (#3168 by [Derek Ellis][dellisd])
- ๐ [Native Driver] Support new kotlin native memory model (#3177 by [Kevin Galligan][kpgalligan])
- ๐ท [JS Driver] Add a driver for SqlJs workers (#3203 by [Derek Ellis][dellisd])
- ๐ [Gradle Plugin] Expose the classpath for SQLDelight tasks
- ๐ [Gradle Plugin] Add a gradle task for squashing migrations
- ๐ [Gradle Plugin] Add a flag to ignore schema definitions during migration checks
- โก๏ธ [MySQL Dialect] Support FOR SHARE and FOR UPDATE in MySQL (#3098)
- ๐ [MySQL Dialect] Support MySQL index hints (#3099)
- [PostgreSQL Dialect] Add date_trunc (#3295 by [Philip Wedemann][hfhbd])
- ๐ [JSON Extensions] Support JSON table functions (#3090)
๐ Changed
- ๐ [Runtime] Remove the AfterVersion type without the driver (#3091)
- ๐ [Runtime] Move Schema type to top-level
- ๐ [Runtime] Open dialect and resolver to support 3rd party implementations (#3232 by [Philip Wedemann][hfhbd])
- [Compiler] Include the dialect used to compile in failure reports (#3086)
- [Compiler] Skip unused adapters (#3162 by [Eliezer Graber][eygraber])
- [Compiler] Use zero based index in PrepareStatement (#3269 by [Philip Wedemann][hfhbd])
- ๐ [Gradle Plugin] Also make the dialect a proper gradle dependency instead of a string (#3085)
- ๐ [Gradle Plugin] Gradle Verify Task: Throw when missing database file. (#3126 by [Niklas Baudy][vanniktech])
๐ Fixed
- ๐ [Gradle Plugin] Minor cleanups and tweaks to the Gradle plugin (#3171 by [Matthew Haughton][3flex])
- ๐ [Gradle Plugin] Dont use an AGP string for the generated directory
- ๐ [Gradle Plugin] Use AGP namespace attribute (#3220)
- ๐ [Gradle Plugin] Do not add kotlin-stdlib as a runtime dependency of the Gradle plugin (#3245 by [Martin Bonnin][mbonnin])
- ๐ง [Gradle Plugin] Simplify the multiplatform configuration (#3246 by [Martin Bonnin][mbonnin])
- ๐ [Gradle Plugin] Support js only projects (#3310 by [Philip Wedemann][hfhbd])
- ๐ [IDE Plugin] Use java home for gradle tooling API (#3078)
- ๐ [IDE Plugin] Load the JDBC driver on the correct classLoader inside the IDE plugin (#3080)
- ๐ [IDE Plugin] Mark the file element as null before invalidating to avoid errors during already existing PSI changes (#3082)
- ๐ [IDE Plugin] Dont crash finding usages of the new table name in an ALTER TABLE statement (#3106)
- โก๏ธ [IDE Plugin] Optimize the inspectors and enable them to fail silently for expected exception types (#3121)
- ๐ [IDE Plugin] Delete files that should be generated directories (#3198)
- ๐ [IDE Plugin] Fix a not-safe operator call
- โก๏ธ [Compiler] Ensure updates and deletes with RETURNING statements execute queries. (#3084)
- [Compiler] Correctly infer argument types in compound selects (#3096)
- [Compiler] Common tables do not generate data classes so dont return them (#3097)
- [Compiler] Find the top migration file faster (#3108)
- [Compiler] Properly inherit nullability on the pipe operator
- ๐ [Compiler] Support the iif ANSI SQL function
- [Compiler] Don't generate empty query files (#3300 by [Philip Wedemann][hfhbd])
- [Compiler] Fix adapter with question mark only (#3314 by [Philip Wedemann][hfhbd])
- [PostgreSQL Dialect] Postgres primary key columns are always non-null (#3092)
- [PostgreSQL Dialect] Fix copy with same name in multiple tables (#3297 by [Philip Wedemann][hfhbd])
- [SQLite 3.35 Dialect] Only show an error when dropping an indexed column from the altered table (#3158 by [Eliezer Graber][eygraber])
- Dialects are now references like actual gradle dependencies.