← Back to Stormify Documentation

AndroidDataSource

Android KDBC implementation backed by android.database.sqlite.SQLiteDatabase.

Wraps a platform SQLite database into the KDBC DataSource interface so the Stormify ORM (and any other KDBC consumer) can run unchanged on Android. The implementation uses native SQLite primitives throughout: SQLiteStatement for INSERT/UPDATE/DELETE with proper typed bindings, SQLiteDatabase.rawQuery for SELECTs, savepoints via raw SQL for nested transactions, and the real sqlite_version() reported through DatabaseMetaData.

Usage

val db = context.openOrCreateDatabase("mydb.db", Context.MODE_PRIVATE, null)
val stormify = Stormify(AndroidDataSource(db))

The wrapped database is not owned by the data source — calling Connection.close does not close the underlying SQLiteDatabase. Lifecycle of the database is the caller's responsibility (typically tied to the Android Application lifetime).

Constructors

Link copied to clipboard
constructor(db: SQLiteDatabase)

Functions

Link copied to clipboard
open override fun getConnection(): Connection

Opens and returns a new database connection. The caller is responsible for closing it.