sqldelight
SQLDelight is a Kotlin code generator that creates type-safe database APIs directly from your SQL statements and schema. It supports multiple SQL dialects (SQLite, MySQL, PostgreSQL) and platforms (Android, iOS, JVM, JavaScript), with compile-time verification to catch errors early.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | sqldelight/sqldelight |
| Owner | sqldelight |
| Primary language | Kotlin |
| License | Apache-2.0 — OSI-approved |
| Stars | 6.8k |
| Forks | 572 |
| Open issues | 371 |
| Latest release | 2.3.2 (2026-03-16) |
| Last updated | 2026-07-08 |
| Source | https://github.com/sqldelight/sqldelight |
What sqldelight is
SQLDelight is a compile-time SQL-to-Kotlin code generator that validates schema, queries, and migrations at build time, supporting Kotlin Multiplatform projects across SQLite, MySQL, and PostgreSQL backends. It eliminates runtime query errors by generating strongly-typed query methods from labeled SQL statements.
Get the sqldelight source
Clone the repository and explore it locally.
git clone https://github.com/sqldelight/sqldelight.gitcd sqldelight# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Requires explicit SQL schema and query files (.sq files); developers must write SQL rather than relying on auto-generated schema.
- Migration management is manual; schema versioning and migration scripts must be maintained alongside generated code.
- Gradle build integration is necessary; compilation of .sq files adds a build step that must be configured correctly.
- IDE plugin available but setup is required for autocomplete and validation features to work in development.
- Learning curve for teams unfamiliar with SQL-first development; code generation model differs from traditional ORM abstractions.
When to avoid it — and what to weigh
- Heavy Object-Relational Mapping (ORM) Needs — If you need automatic relationship traversal, lazy loading, or complex entity associations without writing SQL, consider traditional ORMs. SQLDelight requires explicit query definition.
- Non-Kotlin Technology Stack — SQLDelight generates Kotlin code exclusively. Projects in Java-only, Python, Node.js, or Go ecosystems will not benefit directly.
- Rapid Prototyping with Minimal Schema Definition — If schema fluidity and minimal upfront SQL writing are priorities, code-first ORM frameworks may be faster. SQLDelight requires explicit schema and query definitions.
- Unsupported Database Engines — Limited dialect support (no Oracle, SQL Server, CockroachDB as first-class targets). H2/HSQL support is marked experimental.
License & commercial use
Apache License 2.0 (Apache-2.0). This is an OSI-approved permissive open-source license with clear terms for modification, distribution, and use.
Apache 2.0 permits commercial use, modification, and distribution. No licensing fees or commercial restrictions are imposed by the license itself. Verify any proprietary IDE plugin usage aligns with your compliance requirements.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
SQLDelight generates parameterized queries at compile time, reducing SQL injection risk compared to string concatenation. Generated code inherits database driver security posture (e.g., SQLite driver on Android, JDBC driver on JVM). Conduct threat modeling for your specific database backend and network security. No security audit findings are provided in available data.
Alternatives to consider
Room (Android Architecture Components)
Android-native alternative with similar compile-time verification and type-safe query generation. Narrower scope (Android only) but tighter integration with Android APIs.
Exposed (JetBrains ORM/DSL)
Kotlin-native ORM providing both DSL and DAO patterns with less manual SQL. Broader ORM features but less explicit query control than SQLDelight.
jOOQ (Java/Kotlin Query Builder)
Mature SQL builder supporting multiple dialects with compile-time query validation. Commercial licensing available; targets JVM primarily, not Multiplatform.
Build on sqldelight with DEV.co software developers
SQLDelight brings compile-time SQL verification and IDE autocomplete to your Kotlin and Multiplatform applications. Evaluate integration with your schema and database backend, then explore the documentation to plan your migration strategy.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
sqldelight FAQ
Does SQLDelight support database migrations?
Can I use SQLDelight with existing databases?
What platforms does SQLDelight support?
Is there a commercial support option?
Custom software development services
Adopting sqldelight is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source databases software in production.
Ready to Add Type-Safe SQL to Your Kotlin Project?
SQLDelight brings compile-time SQL verification and IDE autocomplete to your Kotlin and Multiplatform applications. Evaluate integration with your schema and database backend, then explore the documentation to plan your migration strategy.