sqldelight v2.0.0-alpha01 Release Notes

Release Date: 2022-03-31 // almost 2 years ago
  • ๐Ÿš€ 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

    • First, you'll need to replace all occurrences of com.squareup.sqldelight with app.cash.sqldelight
    • Second, you'll need to replace all occurrences of app.cash.sqldelight.android with app.cash.sqldelight.driver.android
    • Third, you'll need to replace all occurrences of app.cash.sqldelight.sqlite.driver with app.cash.sqldelight.driver.jdbc.sqlite
    • Fourth, you'll need to replace all occurrences of app.cash.sqldelight.drivers.native with app.cash.sqldelight.driver.native
    • โšก๏ธ 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 {
        packageName = "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

    • ๐Ÿ”Œ [IDE Plugin] Basic suggested migration (by [Alexander Perfilyev][aperfilyev])
    • ๐Ÿ”Œ [IDE Plugin] Add import hint action (by [Alexander Perfilyev][aperfilyev])
    • ๐Ÿ”Œ [IDE Plugin] Add kotlin class completion (by [Alexander Perfilyev][aperfilyev])
    • ๐Ÿ”Œ [Gradle Plugin] Add shortcut for Gradle type safe project accessors (by [Philip Wedemann][hfhbd])
    • [Compiler] Customize codegen based on dialect (by [Marius Volkhart][MariusV])
    • [JDBC Driver] Add common types to JdbcDriver (by [Marius Volkhart][MariusV])
    • ๐Ÿ‘ [SQLite] Add support for the sqlite 3.35 (by [Eliezer Graber][eygraber])
    • ๐Ÿ‘ [SQLite] Add support for ALTER TABLE DROP COLUMN (by [Eliezer Graber][eygraber])
    • ๐Ÿ‘ [SQLite] Add support for Sqlite 3.30 dialect (by [Eliezer Graber][eygraber])
    • ๐Ÿ‘ [SQLite] Support NULLS FIRST/LAST in sqlite (by [Eliezer Graber][eygraber])
    • ๐Ÿ‘ [HSQL] Add HSQL support for generated clause (by [Marius Volkhart][MariusV])
    • ๐Ÿ‘ [HSQL] Add support for named parameters in HSQL (by [Marius Volkhart][MariusV])
    • [HSQL] Customize the HSQL insert query (by [Marius Volkhart][MariusV])

    ๐Ÿ”„ 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.
    • 0๏ธโƒฃ [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][PaulWoitaschek])
    • ๐Ÿšš [JS Driver] Remove sql.js dependency from sqljs-driver (by [Derek Ellis][dellisd])
    • ๐Ÿšš [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][andersio])
    • ๐Ÿ”Œ [IDE Plugin] Fix error message to allow jumping to error (by [Philip Wedemann][hfhbd])
    • ๐Ÿ”Œ [IDE Plugin] Add missing inspection descriptions (#2768 by [Alexander Perfilyev][aperfilyev])
    • ๐Ÿ”Œ [IDE Plugin] Fix exception in GotoDeclarationHandler (#2531, #2688, #2804 by [Alexander Perfilyev][aperfilyev])
    • ๐Ÿ”Œ [IDE Plugin] Highlight import keyword (by [Alexander Perfilyev][aperfilyev])
    • ๐Ÿ”Œ [IDE Plugin] Fix unresolved kotlin types (#1678 by [Alexander Perfilyev][aperfilyev])
    • ๐Ÿ“ฆ [IDE Plugin] Fix highlighting for unresolved package (#2543 by [Alexander Perfilyev][aperfilyev])
    • ๐Ÿ”Œ [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][3flex])
    • ๐Ÿ”Œ [IDE Plugin] Use faster annotation API
    • ๐Ÿ”Œ [Gradle Plugin] Explicitly support js/android plugins when adding runtime (by [Zac Sweers][ZacSweers])
    • ๐Ÿ”Œ [Gradle Plugin] Register migration output task without derviving schemas from migrations (#2744 by [Kevin Cianfarini][kevincianfarini])
    • ๐Ÿ”Œ [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][ZacSweers])
    • [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][aperfilyev])
    • ๐Ÿ“ฆ [Compiler] Fix packageName for migration adapter (by [Philip Wedemann][hfhbd])
    • [Compiler] Emit annotations on properties instead of types (#2798 by [Alexander Perfilyev][aperfilyev])
    • [Compiler] Sort arguments before passing to a Query subtype (#2379 by [Alexander Perfilyev][aperfilyev])