sqliteCipher

fun sqliteCipher(context: Context, url: String, password: String, options: ConnectionPool.Options = ConnectionPool.Options(), encoders: ValueEncoderRegistry = ValueEncoderRegistry()): ISQLiteCipher(source)

Creates an encrypted SQLite (SQLCipher) driver on Android.

URL forms:

  • sqlite::memory: — in-memory database (not persisted).

  • sqlite:name.db — a relative name, resolved into the app's private database directory via Context.getDatabasePath.

  • sqlite:/absolute/path.db — an absolute filesystem path, used as-is.

Parameters

context

Android context used to resolve relative database filenames.

url

The SQLite connection URL.

password

The SQLCipher passphrase, applied as PRAGMA key. Pass an empty string for an unencrypted database.

options

Connection pool configuration.

encoders

Optional registry of value encoders used when binding query parameters.


actual fun sqliteCipher(url: String, password: String, options: ConnectionPool.Options, encoders: ValueEncoderRegistry): ISQLiteCipher(source)

Creates an encrypted SQLite (SQLCipher) driver.

Parameters

url

The SQLite connection URL, e.g. sqlite:data.db, sqlite://data.db, sqlite:///abs/path.db or sqlite::memory:.

password

The SQLCipher passphrase, applied as PRAGMA key. Pass an empty string to open an unencrypted database — useful for migrating an existing plaintext file.

options

Connection pool configuration.

encoders

Optional registry of value encoders used when binding query parameters.

Note: on Android, use the sqliteCipher(context, ...) overload instead — a Context is required to resolve a relative database filename to the app's private storage.

expect fun sqliteCipher(url: String, password: String, options: ConnectionPool.Options = ConnectionPool.Options(), encoders: ValueEncoderRegistry = ValueEncoderRegistry()): ISQLiteCipher(source)

Creates an encrypted SQLite (SQLCipher) driver.

Parameters

url

The SQLite connection URL, e.g. sqlite:data.db, sqlite://data.db, sqlite:///abs/path.db or sqlite::memory:.

password

The SQLCipher passphrase, applied as PRAGMA key. Pass an empty string to open an unencrypted database — useful for migrating an existing plaintext file.

options

Connection pool configuration.

encoders

Optional registry of value encoders used when binding query parameters.

Note: on Android, use the sqliteCipher(context, ...) overload instead — a Context is required to resolve a relative database filename to the app's private storage.

actual fun sqliteCipher(url: String, password: String, options: ConnectionPool.Options, encoders: ValueEncoderRegistry): ISQLiteCipher(source)

Creates an encrypted SQLite (SQLCipher) driver.

Parameters

url

The SQLite connection URL, e.g. sqlite:data.db, sqlite://data.db, sqlite:///abs/path.db or sqlite::memory:.

password

The SQLCipher passphrase, applied as PRAGMA key. Pass an empty string to open an unencrypted database — useful for migrating an existing plaintext file.

options

Connection pool configuration.

encoders

Optional registry of value encoders used when binding query parameters.

Note: on Android, use the sqliteCipher(context, ...) overload instead — a Context is required to resolve a relative database filename to the app's private storage.

actual fun sqliteCipher(url: String, password: String, options: ConnectionPool.Options, encoders: ValueEncoderRegistry): ISQLiteCipher(source)

Creates an encrypted SQLite (SQLCipher) driver.

Parameters

url

The SQLite connection URL, e.g. sqlite:data.db, sqlite://data.db, sqlite:///abs/path.db or sqlite::memory:.

password

The SQLCipher passphrase, applied as PRAGMA key. Pass an empty string to open an unencrypted database — useful for migrating an existing plaintext file.

options

Connection pool configuration.

encoders

Optional registry of value encoders used when binding query parameters.

Note: on Android, use the sqliteCipher(context, ...) overload instead — a Context is required to resolve a relative database filename to the app's private storage.