SQLDelight - Generates typesafe Kotlin APIs from SQL

Overview

SQLDelight

See the project website for documentation and APIs

SQLDelight generates typesafe kotlin APIs from your SQL statements. It verifies your schema, statements, and migrations at compile-time and provides IDE features like autocomplete and refactoring which make writing and maintaining SQL simple.

SQLDelight understands your existing SQL schema.

CREATE TABLE hockey_player (
  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  name TEXT NOT NULL,
  number INTEGER NOT NULL
);

It generates typesafe code for any labeled SQL statements.

intro.gif


SQLDelight supports a variety of dialects and platforms:

SQLite

MySQL (JVM)

PostgreSQL (JVM) (Experimental)

HSQL/H2 (JVM) (Experimental)

Snapshots

Snapshots of the development version (including the IDE plugin zip) are available in Sonatype's snapshots repository.

License

Copyright 2016 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Performance bottlneck interacting with statement cache in native

    Performance bottlneck interacting with statement cache in native

    Hi! I'm using SQLDelight on iOS. SQLDelight generates queries that properly setup a unique int identifiers for use with statement caching. I'm doing some performance testing of a date serialization function that we're using for getting dates in and out of a sql column, and I noticed that SQLDelight interacting with the statement cache was the main bottleneck on inserts. Here's a snippet of the query being used:

    fun insert(Comment: Comment) {
            driver.execute(4,
                    """INSERT OR REPLACE INTO Comment VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""", 10) {
                bindString(1, Comment.field)
    /* more bind code followed by notifyQueries*/
        }
    

    We're doing the following to bulk insert these objects:

    queries.transaction {
        for (object in objects) {
            queries.insert(object)
        }
    }
    

    Heaviest trace: screen shot 2019-02-21 at 11 59 01 am

    To insert 100k objects, it takes 17s on my machine. 9s of that is the above trace. Is there a more efficient way in SQLDelight to do this kind of bulk insert? Thanks!

    Update: that trace is a bit misleading. That heavy stack is shared by inserts and fetches: 6s for inserts, 3s for fetches.

    enhancement component: drivers/native 
    opened by benasher44 34
  • Better support for inline data class

    Better support for inline data class

    I like that you can use the inline data class for things like ids. However, the ceremony around it with custom ColumnAdapters and Adapters feels a bit too much.

    I've got 3 tables. Player and Game both for which I have custom Id classes and then PlayerGame to resolve the m:n relationship.

    In order to satisfy sqldelight I need to hook it up with custom converters:

    private val columnAdapterGameId = object : ColumnAdapter<GameId, Long> {
      override fun decode(databaseValue: Long) = GameId(databaseValue)
    
      override fun encode(value: GameId) = value.value
    }
    
    private val columnAdapterPlayerId = object : ColumnAdapter<PlayerId, Long> {
      override fun decode(databaseValue: Long) = PlayerId(databaseValue)
    
      override fun encode(value: PlayerId) = value.value
    }
    
    private val queryWrapper = QueryWrapper(sqliteDriver, Game.Adapter(columnAdapterGameId), Player.Adapter(columnAdapterPlayerId), PlayerGame.Adapter(columnAdapterPlayerId, columnAdapterGameId))
    

    Given that sqldelight can look at the Kotlin code would it be possible to also autogenerate the ColumnAdapter for inline data classes? That way I can reference them directly and don't need to create the Adapters manually. If it can do that, we could even provide default parameters for the QueryWrapper class parameters so that I can end up using:

    private val queryWrapper = QueryWrapper(sqliteDriver)
    

    While still having the possibility to specify converters as I please.

    feature 
    opened by vanniktech 33
  • Gradle task not found

    Gradle task not found

    Component: sqldelight-gradle-plugin Version: both 1.1.0-SNAPSHOT and 1.2.0-SNAPSHOT

    Configuration: build.gradle.kts (common)

    plugins {
        kotlin("multiplatform")
        id("com.squareup.sqldelight")
    }
    apply(from = File("sqldelight.gradle"))
    // ...
    

    sqldelight.gradle (common)

    sqldelight {
        TodoSqlDelightDatabase {
            packageName = "com.sample.todo.data.sqldelight"
            sourceFolders = ["sqldelight"]
            schemaOutputDirectory = file("src/main/sqldelight/migrations")
        }
    }
    

    Step to reproduce: gradlew common:tasks

    // ...
    Sqldelight tasks
    ----------------
    generateAndroidMainTodoSqlDelightDatabaseInterface - Generate androidMain Kotlin interface for TodoSqlDelightDatabase
    generateAndroidMainTodoSqlDelightDatabaseSchema - Generate a .db file containing the current TodoSqlDelightDatabase schema for androidMain.
    generateMetadataMainTodoSqlDelightDatabaseInterface - Generate metadataMain Kotlin interface for TodoSqlDelightDatabase
    generateMetadataMainTodoSqlDelightDatabaseSchema - Generate a .db file containing the current TodoSqlDelightDatabase schema for metadataMain.
    verifyAndroidMainTodoSqlDelightDatabaseMigration - Verify androidMain TodoSqlDelightDatabase migrations and CREATE statements match.
    verifyMetadataMainTodoSqlDelightDatabaseMigration - Verify metadataMain TodoSqlDelightDatabase migrations and CREATE statements match.
    // ...
    

    gradlew common:generateMetadataMainTodoSqlDelightDatabaseInterface

    Configuration on demand is an incubating feature.
    
    > Configure project :common
    Kotlin Multiplatform Projects are an experimental feature.
    Configuring compileKotlinAndroid in project common...
    Configuring compileTestKotlinAndroid in project common...
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Task 'generateMetadataMainTodoSqlDelightDatabaseInterface' not found in project ':common'.
    
    * Try:
    Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to g
    et full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 2s
    
    
    opened by nlgtuankiet 30
  • Is it possible to support other SQL dialects?

    Is it possible to support other SQL dialects?

    Being able to support MySQL or Postgres would be an awesome feature for non-mobile projects.

    Would this be easy to accomplish with sqldelight? Or are things pretty tightly coupled to Sqlite?

    enhancement component: sql-psi 
    opened by Wavesonics 26
  • Add linuxX64 Kotlin Multiplatform target

    Add linuxX64 Kotlin Multiplatform target

    Currently, SQLDelight supports only Apple and Windows as native platform targets. If you want to use it in a project that also targets linux, then you can't even use it for other targets as the gradle plugin seems to attempt to math the native variant:

    Execution failed for task ':cinteropSodiumLinux'.
    > Could not resolve all files for configuration ':linuxSodiumCInterop'.
       > Could not resolve com.squareup.sqldelight:runtime:1.4.0.
         Required by:
             project :
          > Unable to find a matching variant of com.squareup.sqldelight:runtime:1.4.0:
              - Variant 'iosArm32-api' capability com.squareup.sqldelight:runtime:1.4.0:
                  - Incompatible attribute:
                      - Required org.jetbrains.kotlin.native.target 'linux_x64' and found incompatible value 'ios_arm32'.
                  - Other attributes:
                      - Found org.gradle.status 'release' but wasn't required.
                      - Required org.gradle.usage 'kotlin-api' and found compatible value 'kotlin-api'.
                      - Required org.jetbrains.kotlin.platform.type 'native' and found compatible value 'native'.
              - Variant 'iosArm64-api' capability com.squareup.sqldelight:runtime:1.4.0:
                  - Incompatible attribute:
                      - Required org.jetbrains.kotlin.native.target 'linux_x64' and found incompatible value 'ios_arm64'.
                  - Other attributes:
                      - Found org.gradle.status 'release' but wasn't required.
                      - Required org.gradle.usage 'kotlin-api' and found compatible value 'kotlin-api'.
                      - Required org.jetbrains.kotlin.platform.type 'native' and found compatible value 'native'.
    

    and so on for all supported native variants.

    The best fix would be to add the linuxX64 variant as well which probably hasn't happened because all developers are on Mac!?

    Unfortunately, it seems that touchlab's SQLiter needs to add support first.

    feature PR WELCOME! 
    opened by grote 25
  • Kotlin Multiplatform (iOS): not working with Cocoapods plugin

    Kotlin Multiplatform (iOS): not working with Cocoapods plugin

    Tried to use the kotlin native cocoapod gradle plugin. But it produces the error below whenever sqldelight is included as a dependency.

    Undefined symbols for architecture arm64: "_sqlite3_bind_text16", referenced from: _SQLiter_SQLiteStatement_nativeBindString in app(combined.o) "_sqlite3_bind_int64", referenced from: _SQLiter_SQLiteStatement_nativeBindLong in app(combined.o) "_sqlite3_last_insert_rowid", referenced from: _SQLiter_SQLiteStatement_nativeExecuteForLastInsertedRowId in app(combined.o) "_sqlite3_reset", referenced from: _SQLiter_SQLiteConnection_nativeResetStatement in app(combined.o) "_sqlite3_changes", referenced from: _SQLiter_SQLiteStatement_nativeExecuteForChangedRowCount in app(combined.o) _SQLiter_SQLiteStatement_nativeExecuteForLastInsertedRowId in app(combined.o) "_sqlite3_open_v2", referenced from: _SQLiter_SQLiteConnection_nativeOpen in app(combined.o) "_sqlite3_db_config", referenced from: _SQLiter_SQLiteConnection_nativeOpen in app(combined.o) "_sqlite3_busy_timeout", referenced from: _SQLiter_SQLiteConnection_nativeOpen in app(combined.o) "_sqlite3_trace", referenced from: _SQLiter_SQLiteConnection_nativeOpen in app(combined.o) "_sqlite3_bind_parameter_index", referenced from: _SQLiter_SQLiteConnection_nativeBindParameterIndex in app(combined.o) "_sqlite3_column_bytes", referenced from: _SQLiter_SQLiteConnection_nativeColumnGetString in app(combined.o) _SQLiter_SQLiteConnection_nativeColumnGetBlob in app(combined.o) "_sqlite3_finalize", referenced from: _SQLiter_SQLiteStatement_nativeFinalizeStatement in app(combined.o) "_sqlite3_column_text", referenced from: _SQLiter_SQLiteConnection_nativeColumnGetString in app(combined.o) "_sqlite3_column_name", referenced from: _SQLiter_SQLiteConnection_nativeColumnName in app(combined.o) "_sqlite3_bind_double", referenced from: _SQLiter_SQLiteStatement_nativeBindDouble in app(combined.o) "_sqlite3_profile", referenced from: _SQLiter_SQLiteConnection_nativeOpen in app(combined.o) "_sqlite3_close", referenced from: _SQLiter_SQLiteConnection_nativeClose in app(combined.o) _SQLiter_SQLiteConnection_nativeOpen in app(combined.o) "_sqlite3_prepare16_v2", referenced from: _SQLiter_SQLiteConnection_nativePrepareStatement in app(combined.o) "_sqlite3_column_type", referenced from: _SQLiter_SQLiteConnection_nativeColumnIsNull in app(combined.o) _SQLiter_SQLiteConnection_nativeColumnType in app(combined.o) "_sqlite3_column_count", referenced from: _SQLiter_SQLiteConnection_nativeColumnCount in app(combined.o) "_sqlite3_bind_blob", referenced from: _SQLiter_SQLiteStatement_nativeBindBlob in app(combined.o) "_sqlite3_db_readonly", referenced from: _SQLiter_SQLiteConnection_nativeOpen in app(combined.o) "_sqlite3_column_int64", referenced from: _SQLiter_SQLiteConnection_nativeColumnGetLong in app(combined.o) "_sqlite3_bind_null", referenced from: _SQLiter_SQLiteStatement_nativeBindNull in app(combined.o) "_sqlite3_extended_errcode", referenced from: android::throw_sqlite3_exception(sqlite3*) in app(combined.o) android::throw_sqlite3_exception(sqlite3*, char const*) in app(combined.o) "_sqlite3_column_double", referenced from: _SQLiter_SQLiteConnection_nativeColumnGetDouble in app(combined.o) "_sqlite3_column_blob", referenced from: _SQLiter_SQLiteConnection_nativeColumnGetBlob in app(combined.o) "_sqlite3_step", referenced from: _SQLiter_SQLiteConnection_nativeStep in app(combined.o) _SQLiter_SQLiteStatement_nativeExecute in app(combined.o) _SQLiter_SQLiteStatement_nativeExecuteForChangedRowCount in app(combined.o) _SQLiter_SQLiteStatement_nativeExecuteForLastInsertedRowId in app(combined.o) "_sqlite3_clear_bindings", referenced from: _SQLiter_SQLiteConnection_nativeClearBindings in app(combined.o) "_sqlite3_errmsg", referenced from: android::throw_sqlite3_exception(sqlite3*) in app(combined.o) android::throw_sqlite3_exception(sqlite3*, char const*) in app(combined.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

    opened by LiewJunTung 25
  • Antlr dependency clashes with Databinding plugin.

    Antlr dependency clashes with Databinding plugin.

    When you use the databinding plugin with sqldelight you'll get an exception like:

    java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with UUID aadb8d7e-aeef-4415-ad2b-8204d6cf042e (expected ab35191a-1603-487e-b75a-479b831eaf6d or a legacy UUID).
    

    This is because it uses com.tunnelvisionlabs:antlr4 instead of org.antlr:antlr4. These both ship the same classes in the same package but are incompatible on the same classpath.

    An issue has been filed with Google to switch at http://b.android.com/200925

    Until a new android plugin is released, the following workaround can (maybe?) be used:

    buildscript {
      configurations.all {
        resolutionStrategy {
          dependencySubstitution {
            substitute module('com.tunnelvisionlabs:antlr4') with module('org.antlr:antlr4')
          }
        }
      }
    }
    
    component: gradle-plugin 
    opened by JakeWharton 25
  • Database interface occasionally not resolved

    Database interface occasionally not resolved

    Our project has one module (named sqldelight) that depends on SqlDelight directly, and all SqlDelight code (sq files, Kotlin classes referenced in sql files, etc...) as well as some helpers that wrap the generated Database for certain things is in that module. There is another module (models) that has an api dependency on our sqldelight module, and any other module that needs access to Database depends on models.

    For the past few months on our CI machines, the :sqldelight:compileReleaseKotlin occasionally fails with every file in that module that references Database saying that it is an unresolved reference. Running it again usually works. We originally though it was a build cache issue, but we've disabled that and it still happens.

    Lately it has also been happening in Android Studio. Database is highlighted in red with the error Unresolved reference: Database but compilation works, and the generated interface is in the build directory. The only way to fix it is to restart and invalidate caches.

    I've noticed that it tends to happen more often when switching between our dev branch and a long lived feature branch that we have (around 50k lines difference between them and many modules renamed, created, and removed).

    What's the best way to further debug this?

    Build Environment SQLDelight version: 1.4.4 OS: Ubuntu 20.04 Gradle version: 6.7.1 Kotlin version: 1.4.20 AGP Version (if applicable): 4.1.1

    bug 
    opened by eygraber 23
  •  Tables do not support Long

    Tables do not support Long

    I created a table and cannot insert Long values (JdbcSqliteDriver)

    table_regdata:
    CREATE TABLE IF NOT EXISTS RegData
    (CONNECTION_ID INTEGER as Long PRIMARY KEY,
    CONNECTION_COOCKI INTEGER as Long  NOT NULL,
    MY_ID TEXT DEFAULT "" NOT NULL,
    LANG TEXT DEFAULT 'ENG' NOT NULL,
    REQUEST_PROFILE TEXT DEFAULT "" NOT NULL,
    CHECK ((CONNECTION_ID BETWEEN 120000000000000001 AND 129999999999999999) 
    AND (MY_ID = "" OR length(MY_ID)= 18)
    AND length(LANG)= 3
    AND (REQUEST_PROFILE = "" OR (length(REQUEST_PROFILE)= 30
    AND REQUEST_PROFILE != '------------------------------'))
    AND (CONNECTION_COOCKI BETWEEN 100000000000000001 AND 999999999999999999)));
    
    trigger_insert_regdata:
    CREATE TRIGGER TRegData_Insert
           BEFORE INSERT ON RegData
           FOR EACH ROW
           BEGIN
           DELETE FROM RegData;
           END;
           
    insert_regdata:
    REPLACE INTO RegData 
    (CONNECTION_ID, CONNECTION_COOCKI, MY_ID, LANG, REQUEST_PROFILE) 
    VALUES 
    (?, ?, ?, ?, ?);
    
    clear_regdata:
    DELETE FROM RegData;
    
    select_all_regdata:
    SELECT * FROM RegData LIMIT 1;
    

    When I try to insert values:

    insert_regdata(
                    120000000000000018,
                    714022140294589849,
                    "714022140294589849",
                    "ujh",
                    "tretertetertdsfsdgsgsgsfsdfsdd"
                )
    

    instead of the Long value, the value 0

    opened by lemkoleg 23
  • Question about concurrency of writes / transactions

    Question about concurrency of writes / transactions

    Hi, Id like to better know how is concurrency of writes implemented. From my testing it seems that there is some internal synchronization going on, as Thread.sleep(..) within transaction seems to block all other concurrent transactions.

    Also, maybe pointers if concurrent writes are good idea, and/or if I should use my own single threaded rxjava scheduler which would do sequential database writes, rather than relying on this internal mechanism?

    Thanks

    opened by ursusursus 23
  • Support custom mappers for projections with more than 22 columns

    Support custom mappers for projections with more than 22 columns

    Is it a normal behavior that for queries with a LEFT OUTER JOIN, generated code does not give access to the custom mapper ?

    Example :

    select_news_with_picture_from_id:
    SELECT *
    FROM news
    LEFT OUTER JOIN author ON news.authorId = author.id
    WHERE
    news.apiId = ?;
    

    Generated code:

    database.newsQueries.select_news_with_picture_from_id(newsId)
                   .asObservable()
                   .mapToOneNonNull()
    
    bug component: compiler 
    opened by julienbanse 23
  • Schemas not supported

    Schemas not supported

    SQLDelight Version

    2.0.0

    SQLDelight Dialect

    Postgres

    Describe the Bug

    Sqldelight doesn't support schemas. Schemas are an extremely useful tool for encapsulating groups of functions and tables for setting user permissions. This is a common practice when using postgres with Row Level Security (RLS).

    Stacktrace

    No response

    bug 
    opened by ScottPierce 0
  • R2DBC: Support Google Cloud Spanner

    R2DBC: Support Google Cloud Spanner

    Description

    I tried to use Google Cloud Spanner with SqlDelight: https://github.com/hfhbd/sqldelight-spanner-r2dbc There are 4 problems, two of them are needed to fix somehow in sqldelight:

    1. Known problem with R2DBC driver: Spanner R2DBC requires @ as a parameter identifier, no $ nor ? at runtime. So again, we need to generate/replace these identifiers somehow.

    2. Spanner does not support bind(index, value), this throw a UnsupportedOperationException. Instead, you have to use the name of the column: bind(name, value).

    Other "problems" unrelated to sqldelight, there is no native Spanner sqldelight dialect and to test the linked demo, a new release of Spanner driver is required (1.2.1)

    feature 
    opened by hfhbd 1
  • Provide an option to generate normal table class

    Provide an option to generate normal table class

    Description

    Compiler always generate table classes with data class, but data class may generate some useless methods automatically. These methods may bring volume increasing to native targets (like iOS). Maybe gradle plugin can provide an option to generate table classes without data modifier.

    feature 
    opened by yuanguozheng 3
  • Bump intellij to 221.6008.13

    Bump intellij to 221.6008.13

    To build sqlDelight JDK 17 is needed, reason GrammarKit. To use the sqldelight gradle plugin (including compiler and dialects), users need to use JDK 11, reason IntelliJ.

    The runtime (including adapters and extensions) uses JDK 1.8 (previously 1.6), aligned with Kotlin 1.8, now.

    opened by hfhbd 2
  • Update plugin publish to v0.23.1

    Update plugin publish to v0.23.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | com.vanniktech.maven.publish | 0.20.0 -> 0.23.1 | age | adoption | passing | confidence |


    Release Notes

    vanniktech/gradle-maven-publish-plugin

    v0.23.1

    Compare Source

    • Also support publishing sources for the java-test-fixtures plugin in Kotlin/JVM projects.
    • Suppress Gradle warnings when publishing a project that uses java-test-fixtures.

    v0.23.0

    Compare Source

    Updated docs can be found on the new website.

    • NEW: It is now possible to set group id, artifact id directly through the DSL
      mavenPublishing {
        coordinates("com.example", "library", "1.0.3")
      }
      
    • project.group and project.version will still be used as default values for group and version if the GROUP/VERSION_NAME Gradle properties do not exist and coordinates was not called, however there are 2 behavior changes:
      • The GROUP and VERSION_NAME Gradle properties take precedence over project.group and project.version instead of being overwritten by them. If you need to define the properties but replace them for some projects, please use the new coordinates method instead.
      • The GROUP and VERSION_NAME Gradle properties will not be explicitly set as project.group and project.version anymore.
    • NEW: Added dropRepository task that will drop a Sonatype staging repository. It is possible to specify which repository to drop by adding a --repository parameter with the id of the staging repository that was printed during publish. If no repository is specified and there is only one staging repository, that one will be dropped.
    • Added workaround to also publish sources for the java-test-fixtures plugin
    • Fixed publishing Kotlin/JS projects with the base plugin.
    • Fixed that a POM configured through the DSL is incomplete when publishing Gradle plugins.
    • The minimum supported Gradle version has been increased to 7.3.

    v0.22.0

    Compare Source

    • NEW: When publishing to maven central by setting SONATYPE_HOST or calling publishToMavenCentral(...) the plugin will now explicitly create a staging repository on Sonatype. This avoids issues where a single build would create multiple repositories
    • The above change means that the plugin supports parallel builds and it is not neccessary anymore to use --no-parallel and --no-daemon together with publish
    • NEW: When publishing with the publish or publishAllPublicationsToMavenCentralRepository tasks the plugin will automatically close the staging repository at the end of the build if it was successful.
    • NEW: Option to also automatically release the staging repository after closing was susccessful
    SONATYPE_HOST=DEFAULT # or S01
    SONATYPE_AUTOMATIC_RELEASE=true
    

    or

    mavenPublishing {
      publishToMavenCentral("DEFAULT", true)
      // or publishToMavenCentral("S01", true)
    }
    
    • in case the option above is enabled, the closeAndReleaseRepository task is not needed anymore
    • when closing the repository fails the plugin will fail the build immediately instead of timing out
    • when closing the repository fails the plugin will try to print the error messages from Nexus
    • increased timeouts for calls to the Sonatype Nexus APIs
    • fixed incompatibility with the com.gradle.plugin-publish plugin
    • added wokaround for Kotlin multiplatform builds reporting disabled build optimizations (see KT-46466)

    v0.21.0

    Compare Source

    Minimum supported Gradle version is now 7.2.0

    Minimum supported Android Gradle Plugin versions are now 7.1.2, 7.2.0-beta02 and 7.3.0-alpha01

    Behavior changes

    The com.vanniktech.maven.publish stops adding Maven Central (Sonatype OSS) as a publishing target and will not enable GPG signing by default. To continue publishing to maven central and signing artifacts either add the following to your gradle.properties:

    SONATYPE_HOST=DEFAULT
    

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • Update kotlin monorepo to v1.8.0

    Update kotlin monorepo to v1.8.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | org.jetbrains.kotlin.js (source) | 1.7.22 -> 1.8.0 | age | adoption | passing | confidence | | org.jetbrains.kotlin.jvm (source) | 1.7.22 -> 1.8.0 | age | adoption | passing | confidence | | org.jetbrains.kotlin.android (source) | 1.7.22 -> 1.8.0 | age | adoption | passing | confidence | | org.jetbrains.kotlin.native.cocoapods (source) | 1.7.22 -> 1.8.0 | age | adoption | passing | confidence | | org.jetbrains.kotlin.multiplatform (source) | 1.7.22 -> 1.8.0 | age | adoption | passing | confidence | | org.jetbrains.kotlin:kotlin-gradle-plugin (source) | 1.7.22 -> 1.8.0 | age | adoption | passing | confidence | | org.jetbrains.kotlin:kotlin-test-js (source) | 1.7.22 -> 1.8.0 | age | adoption | passing | confidence | | org.jetbrains.kotlin:kotlin-test-junit (source) | 1.7.22 -> 1.8.0 | age | adoption | passing | confidence | | org.jetbrains.kotlin:kotlin-test (source) | 1.7.22 -> 1.8.0 | age | adoption | passing | confidence |


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 4
Releases(1.5.4)
  • 1.5.4(Oct 6, 2022)

  • 2.0.0-alpha04(Oct 4, 2022)

    Breaking Changes

    • The Paging 3 extension API has changed to only allow int types for the count.
    • The coroutines extension now requires a dispatcher to be passed in instead of defaulting.

    Added

    • [HSQL Dialect] Hsql: Support using DEFAULT for generated columns in Insert (#3372 by Philip Wedemann)
    • [PostgreSQL Dialect] PostgreSQL: Support using DEFAULT for generated columns in INSERT (#3373 by Philip Wedemann)
    • [PostgreSQL Dialect] Add NOW() to PostgreSQL (#3403 by Philip Wedemann)
    • [PostgreSQL Dialect] PostgreSQL Add NOT operator (#3504 by Philip Wedemann)
    • [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)

    Changed

    • [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)
    • [Coroutines Extensions] Remove default params to flow extensions (#3489)

    Fixed

    • [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)

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0-alpha03(Jun 17, 2022)

    Breaking Changes

    • Dialects are now references like actual gradle dependencies.
    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)
    • [IDE Plugin] Add support for the android studio DB inspector (#3107 by Alexander Perfilyev)
    • [Runtime] Add support for async drivers (#3168 by Derek Ellis)
    • [Native Driver] Support new kotlin native memory model (#3177 by Kevin Galligan)
    • [JS Driver] Add a driver for SqlJs workers (#3203 by Derek Ellis)
    • [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)
    • [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)
    • [Compiler] Include the dialect used to compile in failure reports (#3086)
    • [Compiler] Skip unused adapters (#3162 by Eliezer Graber)
    • [Compiler] Use zero based index in PrepareStatement (#3269 by Philip Wedemann)
    • [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)

    Fixed

    • [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)

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0-alpha02(Apr 13, 2022)

    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

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0-alpha01(Apr 1, 2022)

    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)

    Source code(tar.gz)
    Source code(zip)
  • 1.5.3(Nov 23, 2021)

    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

    Source code(tar.gz)
    Source code(zip)
  • 1.5.2(Oct 12, 2021)

    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)

    Source code(tar.gz)
    Source code(zip)
  • 1.5.1(Jul 16, 2021)

    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

    • [JDBC SQLite Driver] Call close() on connection before clearing the ThreadLocal (#2444 by Hannes Struß)

    • [RX extensions] Fix subscription / disposal race leak (#2403 by Pierre Yves Ricau)

    • [Coroutines extension] Ensure we register query listener before notifying

    • [Compiler] Sort notifyQueries to have consistent kotlin output file (by Jiayu Chen)

    • [Compiler] Don't annotate select query class properties with @JvmField (by Eliezer Graber)

    • [IDE Plugin] Fix import optimizer (#2350 by Alexander Perfilyev)

    • [IDE Plugin] Fix unused column inspection (by Alexander Perfilyev)

    • [IDE Plugin] Add nested classes support to import inspection and class annotator (by Alexander Perfilyev)

    • [IDE Plugin] Fix npe in CopyPasteProcessor (#2363 by Alexander Perfilyev)

    • [IDE Plugin] Fix crash in InlayParameterHintsProvider (#2359 by Alexander Perfilyev)

    • [IDE Plugin] Fix insertion of blank lines when copy-pasting any text into create table stmt (#2431 by Alexander Perfilyev)

    Source code(tar.gz)
    Source code(zip)
  • 1.5.0(Apr 23, 2021)

    Added

    • [SQLite Javascript Driver] Enable sqljs-driver publication (#1667 by Derek Ellis)
    • [Paging3 Extension] Extension for Android Paging 3 Library (#1786 by Kevin Cianfarini)
    • [MySQL Dialect] Adds support for mysql's ON DUPLICATE KEY UPDATE conflict resolution. (by Ryan Harter)
    • [SQLite Dialect] Add compiler support for SQLite offsets() (by Quinton Roberts)
    • [IDE Plugin] Add import quick fix for unknown type (#683 by Alexander Perfilyev)
    • [IDE Plugin] Add unused import inspection (#1161 by Alexander Perfilyev)
    • [IDE Plugin] Add unused query inspection (by Alexander Perfilyev)
    • [IDE Plugin] Add unused column inspection (#569 by Alexander Perfilyev)
    • [IDE Plugin] Automatically bring imports on copy/paste (#684 by Alexander Perfilyev)
    • [IDE Plugin] Pop a balloon when there are incompatibilities between gradle/intellij plugin versions
    • [IDE Plugin] Insert Into ... VALUES(?) parameter hints (#506 by Alexander Perfilyev)
    • [IDE Plugin] Inline parameter hints (by Alexander Perfilyev)
    • [Runtime] Include an API in the runtime for running migrations with callbacks (#1844)

    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.

    Source code(tar.gz)
    Source code(zip)
  • 1.4.4(Oct 8, 2020)

    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)

    Source code(tar.gz)
    Source code(zip)
  • 1.4.3(Sep 4, 2020)

    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)

    Source code(tar.gz)
    Source code(zip)
  • 1.4.2(Aug 28, 2020)

    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)

    Source code(tar.gz)
    Source code(zip)
  • 1.4.1(Aug 22, 2020)

    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)

    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(Jun 22, 2020)

    Added

    • [MySQL Dialect] MySQL support (by Jeff Gulbronson & Veyndan Stuart)
    • [PostgreSQL Dialect] Experimental PostgreSQL support (by Veyndan Stuat)
    • [HSQL Dialect] Experimental H2 support (by Marius Volkhart)
    • [SQLite Dialect] SQLite FTS5 support (by Ben Asher & James Palawaga)
    • [SQLite Dialect] Support alter table rename column (#1505 by Angus Holder)
    • [IDE] IDE support for migration (.sqm) files
    • [IDE] Add SQLDelight Live Templates that mimic built-in SQL Live Templates (#1154 by Veyndan Stuart)
    • [IDE] Add new SqlDelight file action (#42 by Roman Zavarnitsyn)
    • [Runtime] transactionWithReturn API for transactions that return results
    • [Compiler] Syntax for grouping multiple SQL statements together in a .sq file
    • [Compiler] Support generating schemas from migration files
    • [Gradle Plugin] Add a task for outputting migration files as valid sql

    Changed

    • [Documentation] Overhaul of the documentation website (by Saket Narayan)
    • [Gradle Plugin] Improve unsupported dialect error message (by Veyndan Stuart)
    • [IDE] Dynamically change file icon based on dialect (by Veyndan Stuart)
    • [JDBC Driver] Expose a JdbcDriver constructor off of javax.sql.DataSource (#1614)

    Fixed

    • [Compiler]Support Javadoc on tables and fix multiple javadoc in one file (#1224)

    • [Compiler] Enable inserting a value for synthesized columns (#1351)

    • [Compiler] Fix inconsistency in directory name sanitizing (by Zac Sweers)

    • [Compiler] Synthesized columns should retain nullability across joins (#1656)

    • [Compiler] Pin the delete statement on the delete keyword (#1643)

    • [Compiler] Fix quoting (#1525 by Angus Holder)

    • [Compiler] Fix the between operator to properly recurse into expressions (#1279)

    • [Compiler] Give better error for missing table/column when creating an index (#1372)

    • [Compiler] Enable using the outer querys projection in join constraints (#1346)

    • [Native Driver] Make execute use transationPool (by Ben Asher)

    • [JDBC Driver] Use the jdbc transaction APIs instead of sqlite (#1693)

    • [IDE] Fix virtualFile references to always be the original file (#1782)

    • [IDE] Use the correct throwable when reporting errors to bugsnag (#1262)

    • [Paging Extension] Fix leaky DataSource (#1628)

    • [Gradle Plugin] If the output db file already exists when generating a schema, delete it (#1645)

    • [Gradle Plugin] Fail migration validation if there are gaps

    • [Gradle Plugin] Explicitely use the file index we set (#1644)

    Source code(tar.gz)
    Source code(zip)
  • 1.3.0-rxjava3-extensions(May 20, 2020)

  • 1.3.0(Apr 3, 2020)

    • New: [Gradle] Dialect property to specify with sql dialect to compile against.
    • New: [Compiler] #1009 Experimental support of the mysql dialect.
    • New: [Compiler] #1436 Support of sqlite:3.24 dialect and upsert.
    • New: [JDBC Driver] Split out JDBC driver from sqlite jvm driver.
    • Fix: [Compiler] #1199 Support lambdas of any length.
    • Fix: [Compiler] #1610 Fix the return type of avg() to be nullable.
    • Fix: [IntelliJ] #1594 Fix path separator handling which broke Goto and Find Usages on Windows.
    Source code(tar.gz)
    Source code(zip)
  • 1.2.2(Jan 23, 2020)

    • New: [Runtime] Support for Windows (mingW), tvOS, watchOS, and macOS architectures.
    • Fix: [Compiler] Return type of sum() should be nullable.
    • Fix: [Paging] Pass Transacter into QueryDataSourceFactory to avoid race conditions.
    • Fix: [IntelliJ Plugin] Don't search through dependencies when looking for a file's package name.
    • Fix: [Gradle] #862 Change validator logs in Gradle to debug level.
    • Enhancement: [Gradle] Convert GenerateSchemaTask to use Gradle worker.
    • Note: sqldelight-runtime artifact renamed to runtime. ios-driver artifact renamed to native-driver
    Source code(tar.gz)
    Source code(zip)
  • 1.2.1(Dec 11, 2019)

    • Fix: [Gradle] Kotlin Native 1.3.60 support.
    • Fix: [Gradle] #1287 Warning when syncing.
    • Fix: [Compiler] #1469 SynetheticAccessor creation for query.
    • Fix: [JVM Driver] Fixed memory leak.
    • NOTE: The coroutine extension artifact requires kotlinx bintray maven repository be added to your buildscript.
    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Aug 30, 2019)

    • New: [Runtime] Stable Flow api.
    • Fix: [Gradle] Kotlin Native 1.3.50 support.
    • Fix: [Gradle] #1380 Clean build sometimes fails.
    • Fix: [Gradle] #1348 Running verify tasks prints "Could not retrieve functions"
    • Fix: [Compile] #1405 Can't build project if query contains FTS table joined.
    • Fix: [Gradle] #1266 Sporadic gradle build failure while having multiple database modules
    Source code(tar.gz)
    Source code(zip)
  • 1.1.4(Jul 11, 2019)

    • New [Runtime] Experimental kotlin Flow api.
    • Fix [Gradle] Kotlin/Native 1.3.40 compatibility.
    • Fix [Gradle] #1243 Fix for usage of SQLDelight with Gradle configure on demand.
    • Fix [Gradle] #1385 Fix for usage of SQLDelight with incremental annotataion processing.
    • Fix [Gradle] Allow gradle tasks to cache.
    • Fix [Gradle] #1274 Enable usage of sqldelight extension with kotlin dsl.
    • Fix [Compiler] Unique ids are generated for each query deterministically.
    • Fix [Compiler] Only notify listening queries when a transaction is complete.
    Source code(tar.gz)
    Source code(zip)
  • 1.1.3(Apr 14, 2019)

  • 1.1.2(Apr 14, 2019)

    • New: [Runtime] #1267 Logging driver decorator.
    • Fix: [Compiler] #1254 Split string literals which are longer than 2^16 characters.
    • Fix: [Gradle] #1260 generated sources are recognized as iOS source in Multiplatform Project.
    • Fix: [IDE] #1290 kotlin.KotlinNullPointerException in CopyAsSqliteAction.kt:43.
    • Fix: [Gradle] #1268 Running linkDebugFrameworkIos* tasks fail in recent versions.
    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Mar 1, 2019)

    • Fix: [Gradle] Fix module dependency compilation for android projects.
    • Fix: [Gradle] #1246 Set up api dependencies in afterEvaluate.
    • Fix: [Compiler] Array types are properly printed.
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Feb 27, 2019)

    • New: [Gradle] #502 Allow specifying schema module dependencies.
    • Enhancement: [Compiler] #1111 Table errors are sorted before other errors.
    • Fix: [Compiler] #1225 Return the correct type for REAL literals.
    • Fix: [Compiler] #1218 docid propagates through triggers.
    Source code(tar.gz)
    Source code(zip)
  • 1.0.3(Jan 30, 2019)

  • 1.0.2(Jan 27, 2019)

  • 1.0.1(Jan 22, 2019)

    • Enhancement: [Native Driver] Allow passing directory name to DatabaseConfiguration.
    • Enhancement: [Compiler] #1173 Files without a package fail compilation.
    • Fix: [IDE] Properly report IDE errors to Square.
    • Fix: [IDE] #1162 Types in the same package show as error but work fine.
    • Fix: [IDE] #1166 Renaming a table fails with NPE.
    • Fix: [Compiler] #1167 Throws an exception when trying to parse complex SQL statements with UNION and SELECT.
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Jan 8, 2019)

    • New: Complete overhaul of generated code, now in kotlin.
    • New: RxJava2 extensions artifact.
    • New: Android Paging extensions artifact.
    • New: Kotlin Multiplatform support.
    • New: Android, iOS and JVM SQLite driver artifacts.
    • New: Transaction API.
    Source code(tar.gz)
    Source code(zip)
  • 0.2.2(Mar 8, 2016)

    • New: Compile-time validation of the columns used by insert, update, delete, index, and trigger statements.
    • Fix: Don't crash IDE plugin on file move/create.
    Source code(tar.gz)
    Source code(zip)
  • 0.2.1(Mar 7, 2016)

    • New: Ctrl+/ (Cmd+/ on OSX) toggles comment of the selected line(s).
    • New: Compile-time validation of the columns used by SQL queries.
    • Fix: Support Windows paths in both the IDE and Gradle plugin.
    Source code(tar.gz)
    Source code(zip)
Kodein-DB is a Kotlin/Multiplatform embedded NoSQL database that works on JVM, Android, Kotlin/Native and iOS.

Kodein-DB is a Kotlin/Multiplatform embedded NoSQL database that works on JVM, Android, Kotlin/Native and iOS. It is suited for client or mobile applications.

null 277 Dec 3, 2022
Kotlin-Exposed-SQL - Example of using Exposed with Kotlin for the consumption of relational SQL Databases

Kotlin Exposed SQL Sencillo ejemplo sobre el uso y abuso de Exposed ORM de Jetbr

José Luis González Sánchez 3 Jun 14, 2022
Native android app made with Kotlin & Compose with example usage of Ktor, SqlDelight.

Delight-Playground ?? Native Android application built with Kotlin and Jetpack Compose. This app also illustrates the usage of advance libraries such

Kasem SM 41 Nov 6, 2022
A Kotlin native Postgres driver for SqlDelight.

Module postgres-native-sqldelight A native Postgres driver for SqlDelight. Source code Install This package is uploaded to MavenCentral and supports m

Philip Wedemann 19 Dec 30, 2022
Simple application made using Compose Multiplatform, SQLDelight, Decompose.

Notes Simple application made using Compose Multiplatform, SQLDelight and Decompose. Screenshots: Video: TODO There is plans for adding next stuff: Te

Vadim Yaroschuk 20 Dec 23, 2022
Simple note application developed using Jetpack Compose and SqlDelight

Minimal Notes ??‍♂️ Minimalist Note taking app developed using SQL Delight Jetpack Compose UI Technologies Used ?? Kotlin - First class and official p

Unaisul Hadi 19 Dec 11, 2022
Trying to play with Jetpack compose low level animations APIs, which are animate*AsState APIs.

ComposeSimpleAnimation Trying to play with Jetpack compose low level animations APIs, which are animate*AsState APIs that I needed in another project.

Mustafa Ibrahim 39 Dec 10, 2022
Annotation processor that generates a kotlin wrapper class for a java file, enabling named parameters for kotlin callers.

Annotation processor that generates a kotlin wrapper class for a java file, enabling named parameters for kotlin callers.

Josh Skeen 10 Oct 12, 2022
requery - modern SQL based query & persistence for Java / Kotlin / Android

A light but powerful object mapping and SQL generator for Java/Kotlin/Android with RxJava and Java 8 support. Easily map to or create databases, perfo

requery 3.1k Dec 29, 2022
Upsert DSL extension for Exposed, Kotlin SQL framework

Exposed Upsert Upsert DSL extension for Exposed, Kotlin SQL framework. Project bases on various solutions provided by community in the official "Expos

Dzikoysk 23 Oct 6, 2022
Upsert DSL extension for Exposed, Kotlin SQL framework

Exposed Upsert Upsert DSL extension for Exposed, Kotlin SQL framework. Project bases on various solutions provided by community in the official "Expos

Reposilite Playground 23 Oct 6, 2022
sql-delight example, a plugin by Square which is pure kotlin and it is useful in kmm

Sql-Delight-Example01 Developed by Mahdi Razzaghi Ghaleh first example of sql-delight What is SqlDelight? Kotlin Multiplatform is one of the most inte

rq_mehdi 0 Jan 24, 2022
An E-Commerce android App whose frontend is implemented using Kotlin & XML files and backend/database is implemented using My SQL & PHP files

An E-Commerce android App whose frontend is implemented using Kotlin & XML files and backend/database is implemented using My SQL & PHP files

null 4 Aug 25, 2022
Gradle plugin that generates a Swift Package Manager manifest and an XCFramework to distribute a Kotlin Multiplatform library for Apple platforms.

Multiplatform Swift Package This is a Gradle plugin for Kotlin Multiplatform projects that generates an XCFramework for your native Apple targets and

Georg Dresler 262 Jan 5, 2023
An AutoValue extension that generates binary and source compatible equivalent Kotlin data classes of AutoValue models.

AutoValue Kotlin auto-value-kotlin (AVK) is an AutoValue extension that generates binary-and-source-compatible, equivalent Kotlin data classes. This i

Slack 19 Aug 5, 2022
Kotlin compiler plugin generates support synthetic methods for use SaveStateHandle without constants and string variables.

SavedState Compiler Plugin Kotlin compiler plugin generates support methods for use SaveStateHandle without constants and string variables. Example If

Anton Nazarov 3 Sep 20, 2022
A lightweight wrapper around SQLiteOpenHelper which introduces reactive stream semantics to SQL operations.

SQL Brite A lightweight wrapper around SupportSQLiteOpenHelper and ContentResolver which introduces reactive stream semantics to queries. Deprecated T

Square 4.6k Jan 5, 2023
A simple NoSQL client for Android. Meant as a document store using key/value pairs and some rudimentary querying. Useful for avoiding the hassle of SQL code.

SimpleNoSQL A simple NoSQL client for Android. If you ever wanted to just save some data but didn't really want to worry about where it was going to b

Colin Miller 389 Sep 25, 2022
A simple NoSQL client for Android. Meant as a document store using key/value pairs and some rudimentary querying. Useful for avoiding the hassle of SQL code.

SimpleNoSQL A simple NoSQL client for Android. If you ever wanted to just save some data but didn't really want to worry about where it was going to b

Colin Miller 389 Sep 25, 2022
Android library for auto generating SQL schema and Content provider

Android-AnnotatedSQL Android library for auto generating SQL schema and Content Provider by annotations. You will get a full-featured content provider

Gennadiy Dubina 161 Dec 3, 2022