SQLDelight v2.0.0-alpha04 Release Notes

Release Date: 2022-10-03 // over 1 year 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 of AfterVersion which now always has the driver.
    • The Schema type is no longer a subtype of SqlDriver
    • 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])