- Home
- Code Generators
- SQLDelight
SQLDelight
What it is
SQLDelight generates typesafe Kotlin APIs from SQL statements and checks schemas, queries, and migrations during compilation. Its IDE tools include SQL autocomplete and refactoring support. Documented database dialects cover SQLite, MySQL, and PostgreSQL; HSQL and H2 are experimental, and third-party dialects are listed for CockroachDB, DB2, and Oracle. For JVM use, the overview lists MySQL and PostgreSQL connections, with JDBC and R2DBC variants for supported dialects. A Gradle plugin and extensions for Kotlin coroutines, RxJava, and AndroidX Paging are available. The coroutines extension can present a query as a Flow and emit results when queried data changes. A Gradle migration verification task applies migrations to stored schema databases and checks whether they reach the latest schema. SQLDelight is open source under the Apache-2.0 license and has an IntelliJ plugin section in its documentation. It is free at no cost, with no paid tiers stated.
For and against
For
- Checks schemas, SQL, and migrations at compile time.
- IDE support includes SQL autocomplete and refactoring.
- Coroutines extension exposes reactive query results as Flows.
- Free and open source under Apache-2.0.
Against
- HSQL and H2 dialects are experimental.
- CockroachDB, DB2, and Oracle dialects are third-party.
- No paid tiers are stated.
The verdict
SQLDelight offers Kotlin code generation alongside compile-time database checks and IDE support. Confirm that its dialect and connection options fit your project.
Who it suits
SQLDelight suits Kotlin developers who want SQL-backed APIs and compile-time checks for schemas, statements, and migrations. It may also suit projects using its documented dialects and Kotlin integrations.
Plans and prices
Open-source SQLDelight
Apache-2.0 licensed Kotlin library · no hosted service or paid tiers stated
Read 15 Oct 2026 · github.com
SQLDelight
Open-source Kotlin SQL code generation library · no paid tiers stated
Read 4 Oct 2026 · github.com
On the record
- Compile-time checks
- It verifies database schemas, SQL statements, and migrations at compile time.sqldelight.github.io · read 4 Oct 2026
- Database dialects
- Documented dialects include SQLite, MySQL, PostgreSQL, and experimental HSQL/H2, with third-party CockroachDB, DB2, and Oracle dialects listed.sqldelight.github.io · read 4 Oct 2026
- Dialect choices
- The current Gradle documentation lists SQLite dialect modules from versions 3.18 through 3.44 plus HSQL, MySQL, and PostgreSQL modules.sqldelight.github.io · read 15 Oct 2026
- Documentation depth
- The generated API reference exposes separate modules for drivers, compiler, Gradle plugin, dialects, migrations, coroutines, RxJava, paging, JSON, and adapters.sqldelight.github.io · read 15 Oct 2026
- Extensibility
- The project documents creating a custom driver outside its repository by depending on the runtime artifact.sqldelight.github.io · read 15 Oct 2026
- Generated database API
- A Gradle generation task creates the database interface and Kotlin sources from .sq files.kotlinlang.org · read 15 Oct 2026
- Governance change
- Commonhaus announced on June 17, 2026 that SQLDelight joined as a member project after originating at Square and later Block under the lysine.dev banner.commonhaus.org · read 15 Oct 2026
- Gradle integration
- The Gradle plugin lets projects register databases and select a dialect dependency such as sqlite-3-24-dialect.sqldelight.github.io · read 15 Oct 2026
- IDE features
- Its IDE features include SQL autocomplete and refactoring support.sqldelight.github.io · read 4 Oct 2026
- IDE plugin
- The documentation includes an IntelliJ Plugin section for SQLDelight.sqldelight.github.io · read 4 Oct 2026
- IDE plugin distribution
- Development snapshots include an IDE plugin ZIP through Sonatype's Central Portal snapshots repository, while alpha and EAP IntelliJ channels are also documented.sqldelight.github.io · read 15 Oct 2026
- IDE tooling
- The project provides SQL autocomplete and refactoring support in the IDE.sqldelight.github.io · read 15 Oct 2026
- Independent documentation example
- JetBrains' Kotlin Multiplatform tutorial uses SQLDelight to generate shared database code and separate Android and iOS driver factories.kotlinlang.org · read 15 Oct 2026
- Integrations
- The docs provide extensions for Kotlin coroutines, RxJava, and AndroidX Paging, alongside a Gradle plugin.sqldelight.github.io · read 4 Oct 2026
- JVM database connections
- The overview lists MySQL and PostgreSQL on JVM, with JDBC and R2DBC variants shown for supported dialects.sqldelight.github.io · read 4 Oct 2026
- Latest release
- GitHub lists SQLDelight 2.4.1 released on October 6, 2026.github.com · read 15 Oct 2026
- Licence
- The repository is licensed under the Apache License 2.0 and includes the standard no-warranty language.github.com · read 15 Oct 2026
- Licensing
- The GitHub project page lists the Apache-2.0 license.github.com · read 4 Oct 2026
The review
Overview
SQLDelight turns SQL statements into Kotlin APIs, making it a focused database tool for Kotlin application teams. Its compile-time checks and IDE assistance are useful strengths, but its appeal depends on the project’s database dialect and Kotlin stack.
The project is open source under Apache-2.0 and has no paid tiers. Documented dialects include SQLite, MySQL, and PostgreSQL; HSQL and H2 are experimental, while CockroachDB, DB2, and Oracle are provided by third parties. That distinction makes the core documented options a clearer fit than projects relying on experimental or third-party dialects.
Key features
- SQL-to-Kotlin generation: SQLDelight generates typesafe Kotlin APIs from SQL statements. That keeps it relevant for Kotlin codebases, but teams working in other languages should look elsewhere.
- Compile-time database checks: It verifies schemas, statements, and migrations during compilation, helping catch database errors before runtime. This is valuable for projects with evolving schemas, though it does not make every dialect equally established.
- IDE assistance: SQL autocomplete and refactoring support help developers work with SQL in the IDE rather than treating queries as unchecked text.
- Reactive queries: The coroutines extension can expose queries as Flow and emit updated results when queried data changes, a useful option for Kotlin apps that need reactive database updates. Extensions also cover RxJava and AndroidX Paging.
- Migration verification: The Gradle verifySqlDelightMigration task applies migrations to stored schema databases and checks that they reach the latest schema. This adds a concrete check for migration paths, rather than relying only on query validation.
- Connections and tooling: The overview covers MySQL and PostgreSQL on JVM, with JDBC and R2DBC variants for supported dialects, plus a Gradle plugin and an IntelliJ plugin section in the documentation.
Pricing
SQLDelight costs nothing. Its open-source Kotlin SQL code-generation library has no paid tiers stated, so it suits individual developers and teams that want the described generation, checks, and integrations without a subscription. There is no paid plan to compare for additional seats or quotas.
Platforms
SQLDelight lists Android, API, iOS, Linux, macOS, web, and Windows. Its generated language is Kotlin, so the platform breadth does not make it a language-neutral generator.
Who it's for
Choose SQLDelight for Kotlin projects that use a compatible database and benefit from compile-time schema, query, and migration checks. It is less suitable for non-Kotlin teams or projects whose database depends on an experimental or third-party dialect without first confirming that dialect fits their requirements.
Pros and cons
- Pro: Compile-time validation covers schemas, SQL, and migrations, giving database-focused Kotlin projects multiple checks before runtime.
- Pro: Flow support can emit refreshed query results as underlying data changes, with additional coroutine, RxJava, and Paging extensions.
- Pro: Open-source licensing and a free price make the library usable without a paid tier.
- Con: Generated APIs target Kotlin, ruling it out as a general-purpose generator for teams using other languages.
- Con: HSQL/H2 are experimental and CockroachDB, DB2, and Oracle dialects are third-party, so those database choices call for more caution than the documented core dialects.
Alternatives
For another kind of generator or development framework, these tools serve different needs:
- Angular CLI is a free option for Angular projects, with no paid plans or usage limits stated.
- GraphQL Hive suits GraphQL teams wanting a hosted Hobby tier with 1M operations per month, seven-day usage-data retention, and unlimited seats, projects, organizations, schema pushes, and checks.
- Hygen is an open-source code generator distributed through npm, Homebrew, npx, and standalone binaries.
- quicktype offers a free web app and CLI under Apache-2.0.
- Backstage is a free open-source framework for teams seeking a broader development platform.
- Fern has a free tier capped at 10 team members, 1,000 pages, 250 AI credits per month, 2,000 page generations per month, and one site.
- gqlgen is a free Go library for building GraphQL servers.
- JHipster is a free open-source development platform.
Browse Code Generators or Mobile Databases for more options.
Verdict
SQLDelight is a strong choice for Kotlin developers who want SQL-backed APIs with compile-time schema and migration checks, IDE help, and reactive-query integrations at no cost. Its main reason to look elsewhere is a language or database dialect that falls outside its Kotlin focus or documented core support.