SQLDelight
sqldelight.github.io
What it is
SQLDelight generates typesafe Kotlin APIs from SQL statements and checks database schemas, SQL statements, and migrations at compile time. Its IDE features include SQL autocomplete and refactoring support. Documented database dialects include SQLite, MySQL, and PostgreSQL; HSQL and H2 are experimental, while CockroachDB, DB2, and Oracle dialects are listed as third-party options. The JVM connection overview lists MySQL and PostgreSQL, with JDBC and R2DBC variants shown for supported dialects. The project provides a Gradle plugin and extensions for Kotlin coroutines, RxJava, and AndroidX Paging. Its coroutines extension can expose a query as a Flow and emit updated results when the queried data changes. The Gradle verifySqlDelightMigration 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 a free listing at free, with no paid tiers stated. Its listed platforms are Android, API, iOS, Linux, macOS, web, and Windows.
Spec sheet
- What it does
- SQLDelight converts SQL statements into type-safe Kotlin APIs and checks schemas, queries, and migrations during compilation.Read 15 Oct 2026 · sqldelight.github.io
- Purpose
- SQLDelight generates typesafe Kotlin APIs from SQL statements.Read 4 Oct 2026 · sqldelight.github.io
- Platforms
- The docs list SQLite support for Android, native iOS/macOS/Linux/Windows, JVM, JavaScript in browsers and Node, and multiplatform projects.Read 4 Oct 2026 · sqldelight.github.io
- Integrations
- The docs provide extensions for Kotlin coroutines, RxJava, and AndroidX Paging, alongside a Gradle plugin.Read 4 Oct 2026 · sqldelight.github.io
- Compile-time checks
- It verifies database schemas, SQL statements, and migrations at compile time.Read 4 Oct 2026 · sqldelight.github.io
- Database dialects
- Documented dialects include SQLite, MySQL, PostgreSQL, and experimental HSQL/H2, with third-party CockroachDB, DB2, and Oracle dialects listed.Read 4 Oct 2026 · sqldelight.github.io
- Dialect choices
- The current Gradle documentation lists SQLite dialect modules from versions 3.18 through 3.44 plus HSQL, MySQL, and PostgreSQL modules.Read 15 Oct 2026 · sqldelight.github.io
- Documentation depth
- The generated API reference exposes separate modules for drivers, compiler, Gradle plugin, dialects, migrations, coroutines, RxJava, paging, JSON, and adapters.Read 15 Oct 2026 · sqldelight.github.io
- Extensibility
- The project documents creating a custom driver outside its repository by depending on the runtime artifact.Read 15 Oct 2026 · sqldelight.github.io
- Generated database API
- A Gradle generation task creates the database interface and Kotlin sources from .sq files.Read 15 Oct 2026 · kotlinlang.org
- 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.Read 15 Oct 2026 · commonhaus.org
- Gradle integration
- The Gradle plugin lets projects register databases and select a dialect dependency such as sqlite-3-24-dialect.Read 15 Oct 2026 · sqldelight.github.io
- IDE features
- Its IDE features include SQL autocomplete and refactoring support.Read 4 Oct 2026 · sqldelight.github.io
- IDE plugin
- The documentation includes an IntelliJ Plugin section for SQLDelight.Read 4 Oct 2026 · sqldelight.github.io
- 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.Read 15 Oct 2026 · sqldelight.github.io
- IDE tooling
- The project provides SQL autocomplete and refactoring support in the IDE.Read 15 Oct 2026 · sqldelight.github.io
- Independent documentation example
- JetBrains' Kotlin Multiplatform tutorial uses SQLDelight to generate shared database code and separate Android and iOS driver factories.Read 15 Oct 2026 · kotlinlang.org
- JVM database connections
- The overview lists MySQL and PostgreSQL on JVM, with JDBC and R2DBC variants shown for supported dialects.Read 4 Oct 2026 · sqldelight.github.io
- Latest release
- GitHub lists SQLDelight 2.4.1 released on October 6, 2026.Read 15 Oct 2026 · github.com
- Licence
- The repository is licensed under the Apache License 2.0 and includes the standard no-warranty language.Read 15 Oct 2026 · github.com
- Licensing
- The GitHub project page lists the Apache-2.0 license.Read 4 Oct 2026 · github.com
- Limit: snapshot complexity
- An independent technical review notes that snapshot documentation is published separately and that the IDE plugin is described as a snapshot artifact rather than a released compiler-pinned build.Read 15 Oct 2026 · hysenlabs.com
- Maintainer transition
- Jake Wharton wrote that SQLDelight and related projects moved away from single-company stewardship to Commonhaus and lysine.dev in June 2026.Read 15 Oct 2026 · jakewharton.com
- Maven publication
- Maven Repository lists app.cash.sqldelight:core as shared code for the Gradle and IntelliJ plugins and identifies its licence as Apache 2.0.Read 15 Oct 2026 · mvnrepository.com
- Migration checks
- The Gradle verifySqlDelightMigration task applies migrations to stored schema databases and checks that they reach the latest schema.Read 4 Oct 2026 · sqldelight.github.io
- Migrations
- The compiler validates database migrations, and the Gradle tooling includes migration generation and verification tasks.Read 15 Oct 2026 · sqldelight.github.io
- Native driver limit
- NativeSqliteDriver uses separate reader and transaction pools, and one transaction cannot be operated from multiple threads.Read 15 Oct 2026 · sqldelight.github.io
- Native requirement
- Since version 2.0, the Native driver supports only Kotlin/Native's new memory manager.Read 15 Oct 2026 · sqldelight.github.io
- Platform drivers
- SQLDelight supplies platform-specific SQLite drivers, including AndroidSqliteDriver and NativeSqliteDriver, which applications instantiate separately per platform.Read 15 Oct 2026 · kotlinlang.org
- Praise: shared code
- An independent 2026 KMP guide praises SQLDelight because SQL written in .sq files can be validated at compile time and called from commonMain across targets.Read 15 Oct 2026 · ktdevlog.com
- Praise: single data layer
- A LinkedIn engineering post reports that a team consolidated schemas, queries, migrations, caching, pagination, and conflict handling into one shared Android/iOS SQLDelight layer.Read 15 Oct 2026 · linkedin.com
- Project origin
- Square's 2019 announcement says SQLDelight began about four years earlier on Android ContentValues and SQLiteOpenHelper APIs and was later rewritten in Kotlin for multiplatform use.Read 15 Oct 2026 · developer.squareup.com
- Public API
- Generated API and runtime modules are publicly documented, including SqlDriver, AndroidSqliteDriver, JdbcDriver, NativeSqliteDriver, queryables, transactions, and adapters.Read 15 Oct 2026 · sqldelight.github.io
- Reactive queries
- The coroutines extension can expose a query as a Flow and emit updated results when the queried database data changes.Read 4 Oct 2026 · sqldelight.github.io
- Recent release change
- Version 2.4.1 added Android SQLite transaction documentation, improved large-project code-generation speed, and moved IntelliJ crash reporting to JetBrains Marketplace.Read 15 Oct 2026 · github.com
- Security and compliance
- The opened project and documentation pages do not state a security certification or compliance standard.Read 4 Oct 2026 · github.com
- Supported databases
- Official dialects cover SQLite, MySQL, PostgreSQL, and experimental HSQL/H2, with third-party CockroachDB, DB2, and Oracle dialects listed.Read 15 Oct 2026 · sqldelight.github.io
- Supported targets
- Official documentation lists Android, Kotlin Native targets including iOS, macOS, Linux and Windows, JVM, JavaScript browser and Node targets, and Kotlin Multiplatform.Read 15 Oct 2026 · sqldelight.github.io
- Type-safe queries
- Each labeled SQL statement produces a generated type-safe function and each .sq file receives a generated Queries object.Read 15 Oct 2026 · sqldelight.github.io
Plans and prices
Strong points and limits
Strong points
- Checks schemas, statements, and migrations at compile time
- Includes SQL autocomplete and refactoring support
- Offers coroutine, RxJava, and AndroidX Paging extensions
- Apache-2.0 licensed and free
Limits
- HSQL and H2 support is experimental
- CockroachDB, DB2, and Oracle use third-party dialects
- No security certification or compliance standard is stated
Who it suits
SQLDelight suits Kotlin developers who want SQL, schemas, and migrations checked at compile time and Kotlin APIs generated from SQL. Its documented integrations and dialects can help teams choose whether it fits their database setup.
SQLDelight in depth
Read the full write-up
SQLDelight is an open-source Kotlin database library that turns SQL statements into generated APIs. It suits Kotlin teams that want compile-time checks around database work; teams using other languages should look elsewhere.
Its strongest case is the combination of SQL-first development, schema and migration checks, and Kotlin integrations, at no cost. The choice depends on whether its dialect support and connection options suit your database.
Overview
SQLDelight keeps SQL as the basis for database access while generating Kotlin APIs from it. Compile-time verification of schemas, statements, and migrations can surface database mistakes before runtime, which is useful for projects where database changes need to remain aligned with application code. It is specifically a Kotlin tool, not a language-neutral generator.
The project is licensed 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 dialects are third-party. That makes the first group the clearer starting point, while the experimental and third-party choices call for checking fit before committing.
Key features
Generated Kotlin APIs: SQL statements become typesafe Kotlin APIs, giving Kotlin applications a direct interface to their SQL. Teams working primarily in other languages will not benefit from this central feature.
Compile-time checks: SQLDelight verifies schemas, statements, and migrations, helping catch inconsistencies during development rather than after deployment.
IDE support: SQL autocomplete and refactoring support can make SQL work more integrated with development. The documentation also includes an IntelliJ plugin section.
Migration verification: The Gradle verifySqlDelightMigration task applies migrations to stored schema databases and checks that they reach the latest schema. This is useful for teams that want migration sequences checked as part of their build workflow.
Reactive and platform integrations: The coroutines extension can expose queries as Flow values and emit updated results when queried data changes. Extensions are also provided for RxJava and AndroidX Paging, alongside a Gradle plugin.
JVM connections: The overview covers MySQL and PostgreSQL connections on JVM, with JDBC and R2DBC variants shown for supported dialects. This is relevant for JVM projects, but the connection path still depends on the dialect in use.
Pricing
SQLDelight costs free. The free plan is the open-source Kotlin SQL code generation library, and no paid tiers are stated. That makes it viable without a software subscription budget; there are no paid-plan seat counts, quotas, or renewal terms to weigh.
Platforms
SQLDelight supports Android, API, iOS, Linux, macOS, web, and Windows. Its supported language is Kotlin, so platform coverage does not make it a fit for projects whose database layer is written in another language.
Who it's for
SQLDelight is a strong candidate for Kotlin developers building database-backed applications who want SQL checked at compile time and migration verification in a Gradle workflow. Teams using SQLite, MySQL, or PostgreSQL have the clearest dialect fit. Those considering experimental HSQL/H2 or third-party CockroachDB, DB2, or Oracle dialects should be more cautious. It is a poor choice for teams seeking language-agnostic code generation.
Pros and cons
Pro: Compile-time checks cover schemas, SQL statements, and migrations, helping catch database issues before runtime.
Pro: Flow, RxJava, and AndroidX Paging extensions provide options for Kotlin applications with reactive or paging needs.
Pro: The open-source library has no paid tiers, so using it does not require a subscription.
Con: Its generated APIs target Kotlin, excluding teams that need a generator for other languages.
Con: Experimental and third-party dialects are less straightforward choices than the documented SQLite, MySQL, and PostgreSQL dialects.
Alternatives
Code Generators and Mobile Databases are useful categories for comparing tools by broader needs. Among the specific alternatives, pick based on what you need generated:
quicktype is another free, open-source Apache-2.0 option, with a web app and CLI; consider it when that combination suits your code-generation task better than SQLDelight's Kotlin SQL focus.
Swagger Codegen is a free open-source option for generating API clients, server stubs, and documentation from OpenAPI specifications; choose it for OpenAPI work rather than SQL-to-Kotlin generation.
TypeSpec is a free, open-source, Microsoft-built, community-supported project with a CLI and online playground; consider it when that project format is a better match than SQLDelight's Kotlin database workflow.
Nx offers a free Hobby plan with 50,000 monthly-reset credits, five contributors, and 10 concurrent CI connections; it is a better fit when those build and CI limits suit your needs.
APIMatic has a free plan limited to HTTP plus any two programming languages, one API, 10 endpoints, and one team member; choose it when those API constraints fit better than SQLDelight's database focus.
Stainless has a free plan for up to five generators and five seats, with endpoint and preview-build limits; consider it when those generator and seat allowances fit your project.
Fern has a free plan with team, page, AI-credit, page-generation, and site limits; consider it when those allowances suit your use case.
Angular CLI is a free alternative with no paid plans or usage limits stated on its official pages; choose it when it better matches your project.
Verdict
Choose SQLDelight for a Kotlin application when you want SQL-derived APIs and compile-time checks for schemas, queries, and migrations without paying for a license. Look elsewhere if you need another target language, or if your required database depends on an experimental or third-party dialect that does not meet your project's needs.
Verdict
SQLDelight combines Kotlin code generation with compile-time database checks and IDE support. Review the dialect status and connection details for your database before adopting it.
Where Specifiction places it
- Mobile Databases#5 of 268.3
- Code Generators#8 of 338.4