Overview
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.
SQLDelight supports a variety of dialects and platforms:
SQLite
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.
// settings.gradle.kts
pluginManagement {
repositories {
gradlePluginPortal()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}
}
// build.gradle.kts
plugins {
id("com.squareup.sqldelight") version "SNAPSHOT-VERSION"
}
repositories {
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}