DBOpenHelper

open class DBOpenHelper : SQLiteOpenHelper

Helper class to manage SmartStore's database creation and version management.

Properties

Link copied to clipboard
val DATABASES: String = "databases"
Link copied to clipboard
val DB_VERSION: Int = 3
Link copied to clipboard
val DEFAULT_DB_NAME: String = "smartstore"
Link copied to clipboard

Functions

Link copied to clipboard
open fun changeKey(db: SQLiteDatabase, oldKey: String, newKey: String)
Changes the encryption key on the database.
Link copied to clipboard
open fun close()
Link copied to clipboard
open fun deleteAllDatabases(ctx: Context, userAccount: UserAccount)
Deletes all databases of given user.
Link copied to clipboard
Deletes all remaining authenticated databases.
Link copied to clipboard
open fun deleteDatabase(ctx: Context, account: UserAccount)
Deletes the underlying database for the specified user account.
open fun deleteDatabase(ctx: Context, account: UserAccount, communityId: String)
open fun deleteDatabase(ctx: Context, dbNamePrefix: String, account: UserAccount, communityId: String)
Deletes the underlying database for the specified user and community.
Link copied to clipboard
Link copied to clipboard
open fun getGlobalDatabasePrefixList(ctx: Context, account: UserAccount, communityId: String): List<String>
Returns a list of all prefixes for user databases.
Link copied to clipboard
open fun getOpenHelper(encryptionKey: String, ctx: Context, account: UserAccount): DBOpenHelper
Returns the DBOpenHelper instance associated with this user account.
open fun getOpenHelper(encryptionKey: String, ctx: Context, account: UserAccount, communityId: String): DBOpenHelper
Returns the DBOpenHelper instance associated with this user and community.
open fun getOpenHelper(encryptionKey: String, ctx: Context, dbNamePrefix: String, account: UserAccount, communityId: String): DBOpenHelper
Returns the DBOpenHelper instance for the given database name.
Link copied to clipboard
open fun getReadableDatabase(): SQLiteDatabase
Link copied to clipboard
open fun getUserDatabasePrefixList(ctx: Context, account: UserAccount, communityId: String): List<String>
Returns a list of all prefixes for user databases.
Link copied to clipboard
open fun getWritableDatabase(): SQLiteDatabase
Link copied to clipboard
open fun onBeforeDelete(p: SQLiteDatabase)
Link copied to clipboard
open fun onConfigure(db: SQLiteDatabase)
Link copied to clipboard
open fun onCreate(db: SQLiteDatabase)
Link copied to clipboard
open fun onDowngrade(p: SQLiteDatabase, p1: Int, p2: Int)
Link copied to clipboard
open fun onOpen(p: SQLiteDatabase)
Link copied to clipboard
open fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int)
Link copied to clipboard
open fun removeAllFiles(dir: File): Boolean
Removes all files and folders in the given directory recursively as well as removes itself.
Link copied to clipboard
Link copied to clipboard
open fun smartStoreExists(ctx: Context, account: UserAccount, communityId: String): Boolean
Determines if a smart store currently exists for the given account and/or community id.
open fun smartStoreExists(ctx: Context, dbNamePrefix: String, account: UserAccount, communityId: String): Boolean
Determines if a smart store currently exists for the given database name, account and/or community id.