Databases for Android multi-tenant AI Apps.
Turso · Docs · Quickstart · SDK Reference · Blog & Tutorials
## Features - 🔌 Works offline with [Embedded Replicas](https://docs.turso.tech/features/embedded-replicas/introduction) - 🌎 Works with remote Turso databases - ✨ Works with Turso [AI & Vector Search](https://docs.turso.tech/features/ai-and-embeddings) > [!WARNING] > This SDK is currently in technical preview. Join us in Discord to report any issues. ## Install Add `libsql` to your Gradle dependencies: ```kotlin dependencies { implementation("tech.turso.libsql:libsql:0.1.0") } ``` > [!NOTE] > This will only work with the Android Gradle Plugin for now. ## Quickstart The example below uses Embedded Replicas and syncs data every 1000ms from Turso. ```kotlin import tech.turso.libsql.Libsql val db = Libsql.open( path = "./local.db", url = "TURSO_DATABASE_URL",, authToken = "TURSO_AUTH_TOKEN", syncInterval: 1000 ) val conn = db.connect() db.connect().use { it.execute_batch(" CREATE TABLE IF NOT EXISTS users ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT ); INSERT INTO users (name) VALUES ('Iku'); ") } db.connect().use { it.query("SELECT * FROM users WHERE id = ?", 1) } ``` ## Documentation Visit our [official documentation](https://docs.turso.tech/sdk/kotlin). ## Support Join us [on Discord](https://tur.so/discord-android) to get help using this SDK. Report security issues [via email](mailto:security@turso.tech). ## Contributors See the [contributing guide](CONTRIBUTING.md) to learn how to get involved. ![Contributors](https://contrib.nn.ci/api?repo=tursodatabase/libsql-android)