Back to Sqldelight

Index

docs/index.md

2.3.24.8 KB
Original Source

!!! info "SQLDelight 2.0"

If you are currently using SQLDelight 1.x, [check out the docs](upgrading-2.0) on upgrading to SQLDelight 2.0!

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 takes your existing SQL schema,

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

and generates typesafe code to run your SQL statements and queries.


Supported Dialects and Platforms

SQLDelight supports a variety of SQL dialects and platforms.

<div class="cash-grid" markdown="1"> <div class="cash-grid-item" markdown="1"> <p class="cash-grid-title" markdown="1">:simple-sqlite:{ .lg .middle } __SQLite__</p> <hr /> [:octicons-arrow-right-24: __Android__](android_sqlite) [:octicons-arrow-right-24: __Native__ (iOS, macOS, Linux, Windows)](native_sqlite) [:octicons-arrow-right-24: __JVM__](jvm_sqlite) [:octicons-arrow-right-24: __JavaScript__ (Browser)](js_sqlite) [:octicons-link-external-16: __JavaScript__ (Node)](https://github.com/wojta/sqldelight-node-sqlite3-driver) [:octicons-arrow-right-24: __Multiplatform__](multiplatform_sqlite) </div> <div class="cash-grid-item" markdown="1"> <p class="cash-grid-title" markdown="1">:simple-mysql:{ .lg .middle } __MySQL__</p> <hr /> [:octicons-arrow-right-24: __JVM__ (JDBC)](jvm_mysql) :octicons-arrow-right-24: __JVM__ (R2DBC) </div> <div class="cash-grid-item" markdown="1"> <p class="cash-grid-title" markdown="1">:simple-postgresql:{ .lg .middle } __PostgresSQL__</p> <hr /> [:octicons-arrow-right-24: __JVM__ (JDBC)](jvm_postgresql) :octicons-arrow-right-24: __JVM__ (R2DBC) [:octicons-link-external-16: __Native__ (macOS, Linux)](https://github.com/hfhbd/postgres-native-sqldelight) </div> <div class="cash-grid-item" markdown="1"> <p class="cash-grid-title" markdown="1">__HSQL / H2__ (Experimental)</p> <hr /> [:octicons-arrow-right-24: __JVM__ (JDBC)](jvm_h2) :octicons-arrow-right-24: __JVM__ (R2DBC) </div> </div>

Third party dialects

<div class="cash-grid" markdown="1"> <div class="cash-grid-item" markdown="1"> <p class="cash-grid-title" markdown="1">:simple-cockroachlabs:{ .lg .middle } __CockroachDB__</p> <hr /> [:octicons-arrow-right-24: __JVM__](https://github.com/Faire/sqldelight-cockroachdb-dialect/) </div> <div class="cash-grid-item" markdown="1"> <p class="cash-grid-title" markdown="1">:simple-ibm:{ .lg .middle } __DB2__</p> <hr /> [:octicons-arrow-right-24: __JVM__](https://github.com/hfhbd/sqldelight-db2-dialect) </div> <div class="cash-grid-item" markdown="1"> <p class="cash-grid-title" markdown="1">:simple-oracle:{ .lg .middle } __Oracle DB__</p> <hr /> [:octicons-arrow-right-24: __JVM__](https://github.com/hfhbd/sqldelight-oracle-dialect) </div> </div>

Snapshots

Snapshots of the development version (including the IDE plugin zip) are available in the Central Portal Snapshots repository. Note that all coordinates are app.cash.sqldelight instead of com.squareup.sqldelight for 2.0.0+ SNAPSHOTs.

Documentation pages for the latest snapshot version can be found here.

=== "Kotlin" ```kotlin // settings.gradle.kts pluginManagement { repositories { gradlePluginPortal() maven(url = "https://central.sonatype.com/repository/maven-snapshots") } }

// build.gradle.kts
plugins {
    id("app.cash.sqldelight") version "SNAPSHOT-VERSION"
}

repositories {
    maven(url = "https://central.sonatype.com/repository/maven-snapshots")
}
```

=== "Groovy" ```groovy // settings.gradle pluginManagement { repositories { gradlePluginPortal() maven { url "https://central.sonatype.com/repository/maven-snapshots" } } }

// build.gradle
plugins {
    id "app.cash.sqldelight" version "SNAPSHOT-VERSION"
}

repositories {
    maven { url "https://central.sonatype.com/repository/maven-snapshots" }
}
```

Alpha IDE plugins are also available by using the alpha channel in IntelliJ: https://plugins.jetbrains.com/plugins/alpha/com.squareup.sqldelight. Snapshots are also available in the EAP channel: https://plugins.jetbrains.com/plugins/eap/com.squareup.sqldelight