StorageDomain.Database


class StorageDomain.Database : StorageDomain


Targets structured SQLite/Room database records.

Summary

Public constructors

Database(
    dbName: String,
    table: String,
    primaryKeyCol: String,
    primaryKeyVal: Any,
    columnValues: Map<String, Any?>,
    isDeviceProtectedStorage: Boolean
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Map<String, Any?>

A non-empty Map of column names to their values to populate or verify.

String

The name of the SQLite database file on the device.

Boolean

Whether the database is in device-protected storage, which is available before the user first unlocks the device, rather than in the default storage of the app.

String

The column name of the primary key used to identify the target record.

Any

The value of the primary key used to identify the target record.

String

The target table name to insert into or query from.

Public constructors

Database

Database(
    dbName: String,
    table: String,
    primaryKeyCol: String,
    primaryKeyVal: Any,
    columnValues: Map<String, Any?>,
    isDeviceProtectedStorage: Boolean = false
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

columnValues

Added in 1.0.0-alpha04
val columnValues: Map<String, Any?>

A non-empty Map of column names to their values to populate or verify. Supported types are: String, Int, Long, Float, Double, Boolean, or null, which stands for SQL NULL. It may include primaryKeyCol, matched case-insensitively like SQLite column names, but only with a value whose string form equals that of primaryKeyVal; otherwise construction fails with an IllegalArgumentException. When it is omitted, primaryKeyVal is written to that column. The domain keeps a copy of it.

dbName

Added in 1.0.0-alpha04
val dbName: String

The name of the SQLite database file on the device.

isDeviceProtectedStorage

Added in 1.0.0-alpha04
val isDeviceProtectedStorage: Boolean

Whether the database is in device-protected storage, which is available before the user first unlocks the device, rather than in the default storage of the app. That is credential-encrypted storage, unless the app sets android:defaultToDeviceProtectedStorage.

primaryKeyCol

Added in 1.0.0-alpha04
val primaryKeyCol: String

The column name of the primary key used to identify the target record.

primaryKeyVal

Added in 1.0.0-alpha04
val primaryKeyVal: Any

The value of the primary key used to identify the target record. Supported types are: String, Int, Long, Float, Double, Boolean.

table

Added in 1.0.0-alpha04
val table: String

The target table name to insert into or query from.