SqlNormalizedCacheFactory

constructor(context: Context, name: String? = "apollo.db", factory: SupportSQLiteOpenHelper.Factory = FrameworkSQLiteOpenHelperFactory(), configure: (SupportSQLiteDatabase) -> Unit? = null, useNoBackupDirectory: Boolean = false, windowSizeBytes: Long? = null)

Parameters

name

Name of the database file, or null for an in-memory database (as per Android framework implementation).

factory

Factory class to create instances of SupportSQLiteOpenHelper

configure

Optional callback, called when the database connection is being configured, to enable features such as write-ahead logging or foreign key support. It should not modify the database except to configure it.

useNoBackupDirectory

Sets whether to use a no backup directory or not.

windowSizeBytes

Size of cursor window in bytes, per android.database.CursorWindow (Android 28+ only), or null to use the default.


actual constructor(name: String?)
actual constructor(driver: SqlDriver)
constructor(name: String?, baseDir: String?)

Parameters

name

the name of the database or null for an in-memory database

baseDir

the baseDirectory where to store the database. baseDir must exist and be a directory If baseDir is a relative path, it will be interpreted relative to the current working directory


constructor()
actual constructor(name: String?)
actual constructor(driver: SqlDriver)
expect constructor(name: String? = "apollo.db")

Parameters

name

: the name of the database or null for an in-memory database When not in memory, the database will be stored in a platform specific folder

  • on Android it will use Context.getDatabaseName

  • on MacOS, it will use "Application Support/databases/name"

  • on the JVM, it will use "System.getProperty("user.home")/.apollo" Default: "apollo.db"


expect constructor(driver: SqlDriver)
constructor(name: String?, baseDir: String?)

Parameters

name

the name of the database or null for an in-memory database

baseDir

the baseDirectory where to store the database. If baseDir does not exist, it will be created If baseDir is a relative path, it will be interpreted relative to the current working directory


constructor(url: String, properties: Properties = Properties())

Parameters

url

Database connection URL in the form of jdbc:sqlite:path where path is either blank (creating an in-memory database) or a path to a file.

properties

actual constructor(name: String?)
actual constructor(driver: SqlDriver)