libSQL Android Reference
This is currently in technical preview. Join us in Discord to report any issues.
This will only work with the Android Gradle Plugin for now. Fully Kotlin support is coming.
Add libsql as a implementation dependency in Gradle:
libSQL supports connecting to in-memory databases for cases where you don’t require persistence:
You can work locally using an SQLite file:
You can work with embedded replicas that can sync from the remote URL and delegate writes to the remote primary database:
The sync
function allows you to sync manually the local database with the
remote counterpart:
You can pass a string to query()
to invoke a SQL statement, as well as
optional arguments:
libSQL supports the use of positional and named placeholders within SQL statements:
A batch consists of multiple SQL statements executed sequentially within an implicit transaction. The backend handles the transaction: success commits all changes, while any failure results in a full rollback with no modifications.
Interactive transactions in SQLite ensure the consistency of a series of read and write operations within a transaction’s scope. These transactions give you control over when to commit or roll back changes, isolating them from other client activity.
libSQL Android Reference
This is currently in technical preview. Join us in Discord to report any issues.
This will only work with the Android Gradle Plugin for now. Fully Kotlin support is coming.
Add libsql as a implementation dependency in Gradle:
libSQL supports connecting to in-memory databases for cases where you don’t require persistence:
You can work locally using an SQLite file:
You can work with embedded replicas that can sync from the remote URL and delegate writes to the remote primary database:
The sync
function allows you to sync manually the local database with the
remote counterpart:
You can pass a string to query()
to invoke a SQL statement, as well as
optional arguments:
libSQL supports the use of positional and named placeholders within SQL statements:
A batch consists of multiple SQL statements executed sequentially within an implicit transaction. The backend handles the transaction: success commits all changes, while any failure results in a full rollback with no modifications.
Interactive transactions in SQLite ensure the consistency of a series of read and write operations within a transaction’s scope. These transactions give you control over when to commit or roll back changes, isolating them from other client activity.