SQLite
SQLite
Static utilities for creating or accessing SQLite databases from within an Elide-enabled application, or host-side from the Elide runtime; uses native bindings into the SQLite C API.
Usage
Obtain a database via the inMemory or atPath methods:
val db = SQLite.inMemory()
val db = SQLite.atPath(Path.of("my-database.db"))
Optionally, provide SQLiteCreateDatabaseOptions to configure the database:
val db = SQLite.atPath(Path.of("my-database.db"), SQLiteCreateDatabaseOptions.defaults().copy(
readonly = true,
))
Guest Bindings
SQLite databases are enabled for guest use by default, and can be passed without modification between guest and host code; this is also true for SQLite transactions, statements, objects, and so on.
Functions
Create a disk-backed SQLite database instance, at the provided path, and with the provided options, assuming sandbox access to I/O; if no permission is granted for I/O, an error is thrown.
Create a disk-backed SQLite database instance, at the provided path, and with the provided options, assuming sandbox access to I/O; if no permission is granted for I/O, an error is thrown.
Create an in-memory database, and then de-serialize the provided data into that database instance; the returned database contains the provided data.