SQLDelight - Generates typesafe Kotlin APIs from SQL
[PostgreSQL Dialect] Fix postgresql alter table alter column (#4868 by Griffio)
[PostgreSQL Dialect] Fix 4448 missing import for table model (#4885 by Griffio)
[PostgreSQL Dialect] Fixes 4932 postgresql default constraint functions (#4934 by Griffio)
[PostgreSQL Dialect] fixes 4879 postgresql class-cast error in alter table rename column during migrations (#4880 by Griffio)
[PostgreSQL Dialect] Fix 4474 PostgreSql create extension (#4541 by Griffio)
[PostgreSQL Dialect] Fixes 5018 PostgreSql add Primary Key not nullable types (#5020 by Griffio)
[PostgreSQL Dialect] Fixes 4703 aggregate expressions (#5071 by Griffio)
[PostgreSQL Dialect] Fixes 5028 PostgreSql json (#5030 by Griffio)
[PostgreSQL Dialect] Fixes 5040 PostgreSql json operators (#5041 by Griffio)
[PostgreSQL Dialect] Fixes json operator binding for 5040 (#5100 by Griffio)
[PostgreSQL Dialect] Fixes 5082 tsvector (#5104 by Griffio)
[PostgreSQL Dialect] Fixes 5032 column adjacency for PostgreSql UPDATE FROM statement (#5035 by Griffio)
[SQLite Dialect] fixes 4897 sqlite alter table rename column (#4899 by Griffio)
[IDE Plugin] Fix error handler crash (#4988 by Alexander Perfilyev)
[IDE Plugin] BugSnag fails to init in IDEA 2023.3 (by Alexander Perfilyev)
[IDE Plugin] PluginException when opening .sq file in IntelliJ via plugin (by Alexander Perfilyev)
[IDE Plugin] Dont bundle the kotlin lib into the intellij plugin as its already a plugin dependency (#5126)
[IDE Plugin] Use the extensions array instead of stream (#5127)
[Compiler] Fix compilation of grouped statements with returns and no parameters (#4699 by Griffio)
[Compiler] Bind arguments with SqlBinaryExpr (#4604 by Griffio)
[IDE Plugin] Use IDEA Project JDK if set (#4689 by Griffio)
[IDE Plugin] Fix "Unknown element type: TYPE_NAME" error in IDEA 2023.2 and greater (#4727)
[IDE Plugin] Fixed some compatibility issues with 2023.2
[Gradle Plugin] Correct documentation of verifyMigrationTask Gradle task (#4713 by Josh Friend)
[Gradle Plugin] Add Gradle task output message to help users generate a database before verifying a database (#4684 by Jingwei)
[PostgreSQL Dialect] Fix the renaming of PostgreSQL columns multiple times (#4566 by Griffio)
[PostgreSQL Dialect] Fix 4714 postgresql alter column nullability (#4831 by Griffio)
[PostgreSQL Dialect] Fix 4837 alter table alter column (#4846 by Griffio)
[PostgreSQL Dialect] Fix 4501 PostgreSql sequence (#4528 by Griffio)
[SQLite Dialect] Allow JSON binary operator to be used on a column expression (#4776 by Eliezer Graber)
[SQLite Dialect] Update From false positive for multiple columns found with name (#4777 by Eliezer Graber)
[Native Driver] Support named in-memory databases (#4662 by Matthew Nelson)
[Native Driver] Ensure thread safety for query listener collection (#4567 by Kevin Galligan)
[JDBC Driver] Fix a connection leak in the ConnectionManager (#4589 by Marius Volkhart)
[JDBC Driver] Fix JdbcSqliteDriver url parsing when choosing ConnectionManager type (#4656 by Matthew Nelson)
Please see the detailed upgrading information for how to upgrade from SQLDelight 1.x to SQLDelight 2.0. The IntelliJ plugin needs to go through an approval before it lands on the marketplace inside of IntelliJ but can be downloaded and installed from disk below.
The below notes are all changes from SQLDelight 1.5.5. For only the changes from SQLDelight 2.0.0-rc02 please see the Changelog. Some highlights which signify major changes are highlighted.
migrate
fungetObject
method supports automatic filling of the actual type. (#3401 by Rob X)[Coroutines Extensions] Remove default params to flow extensions (#3489)
[Gradle Plugin] Use stable output path for generated source (#4269 by Josh Friend)
[Gradle Plugin] Gradle tweaks (#4222 by Matthew Haughton)
NOTE: IntelliJ plugins now go through an approval process, if you want the latest plugin you can download it below in these release notes.
[R2DBC Driver] R2DBC: Await closing the driver (#4139 by Philip Wedemann)
[Compiler] Include PRAGMAs from migrations in database create(SqlDriver) (#3845 by Marius Volkhart)
[Compiler] Fix codegen for RETURNING clause (#3872 by Marius Volkhart)
[Compiler] Dont generate types for virtual tables (#4015)
[Gradle Plugin] Small Gradle plugin QoL improvements (#3930 by Zac Sweers)
[IDE Plugin] Fix unresolved kotlin types (#3924 by Alexander Perfilyev)
[IDE Plugin] Fix for expand wildcard intention to work with qualifier (#3979 by Alexander Perfilyev)
[IDE Plugin] Use available jdk if java home is missing (#3925 by Alexander Perfilyev)
[IDE Plugin] Fix find usages on package names (#4010)
[IDE Plugin] Dont show auto imports for invalid elements (#4008)
[IDE Plugin] Do not resolve if a dialect is missing (#4009)
[IDE Plugin] Ignore IDE runs of the compiler during an invalidated state (#4016)
[IDE Plugin] Add support for IntelliJ 2023.1 (#4037 by Madis Pink)
[IDE Plugin] Rename named argument usage on column rename (#4027 by Alexander Perfilyev)
[IDE Plugin] Fix add migration popup (#4105 by Alexander Perfilyev)
[IDE Plugin] Disable SchemaNeedsMigrationInspection in migration files (#4106 by Alexander Perfilyev)
[IDE Plugin] Use sql column name for migration generation instead of type name (#4112 by Alexander Perfilyev)
// build.gradle
sqldelight {
databases { // new wrapper
Database {
packageName = "com.sample"
}
}
}
// build.gradle.kts
sqldelight {
databases { // new wrapper
create("Database") {
packageName.set("com.sample") // packageName is now a Property<String>
}
}
}
migrate
fun[RDBC Driver] Use javaObjectType instead (by Philip Wedemann)
[RDBC Driver] Fix primitive null values in bindStatement (by Philip Wedemann)
[RDBC Driver] Support R2DBC 1.0 (by Philip Wedemann)
[PostgreSQL Dialect] Postgres: Fix Array without type parameter (by Philip Wedemann)
[IDE Plugin] Bump intellij to 221.6008.13 (by Philip Wedemann)
[Compiler] Resolve recursive origin table from pure views (by Philip Wedemann)
[Compiler] Use value classes from table foreign key clause (by Philip Wedemann)
[Compiler] Fix SelectQueryGenerator to support bind expression without parenthesis (by Doogie Min)
[Compiler] Fix duplicate generation of ${name}Indexes variables when using transactions (by Andreas Sacher)
This is a compatibility release for Kotlin 1.8 and IntelliJ 2021+, supporting JDK 17.
This is a compatibility update for Kotlin 1.7.20 and AGP 7.3.0
[Gradle Plugin] Update to Kotlin 1.7.20 (#3542 by Zac Sweers)
[R2DBC Driver] Adopt R2DBC changes which do not always send a value (#3525 by Philip Wedemann)
[HSQL Dialect] Fix failing sqlite VerifyMigrationTask with Hsql (#3380 by Philip Wedemann)
[Gradle Plugin] Convert tasks to use lazy configuration API (by Matthew Haughton)
[Gradle Plugin] Avoid NPEs in Kotlin 1.7.20 (#3398 by Zac Sweers)
[Gradle Plugin] Fix description of squash migrations task (#3449)
[IDE Plugin] Fix NoSuchFieldError in newer Kotlin plugins (#3422 by Madis Pink)
[IDE Plugin] IDEA: UnusedQueryInspection - fix ArrayIndexOutOfBoundsException. (#3427 by Niklas Baudy)
[IDE Plugin] Use reflection for old kotlin plugin references
[Compiler] Custom dialect with extension function don't create imports (#3338 by Philip Wedemann)
[Compiler] Fix escaping CodeBlock.of("${CodeBlock.toString()}") (#3340 by Philip Wedemann)
[Compiler] Await async execute statements in migrations (#3352)
[Compiler] Fix AS (#3370 by Philip Wedemann)
[Compiler] getObject
method supports automatic filling of the actual type. (#3401 by Rob X)
[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)
[Compiler] Don't allow ABS("foo") (#3430 by Philip Wedemann)
[Compiler] Support inferring kotlin type from other parameters (#3431 by Philip Wedemann)
[Compiler] Always create the database implementation (#3540 by Philip Wedemann)
[Compiler] Relax javaDoc and add it to custom mapper function too (#3554 Philip Wedemann)
[Compiler] Fix DEFAULT in binding (by Philip Wedemann)
[Paging] Fix Paging 3 (#3396)
[Paging] Allow construction of OffsetQueryPagingSource with Long (#3409)
[Paging] Don't statically swap Dispatchers.Main (#3428)
sqldelight {
MyDatabase {
dialect("app.cash.sqldelight:postgres-dialect:2.0.0-alpha03")
}
}
AfterVersionWithDriver
type was removed in favour of AfterVersion
which now always has the driver.Schema
type is no longer a subtype of SqlDriver
PreparedStatement
APIs are now called with zero-based indexes.[Gradle Plugin] Minor cleanups and tweaks to the Gradle plugin (#3171 by Matthew Haughton)
[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)
[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)
[Compiler] Fix adapter with question mark only (#3314 by Philip Wedemann)
[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)
[SQLite 3.35 Dialect] Only show an error when dropping an indexed column from the altered table (#3158 by Eliezer Graber)