SQLite

SQLite entry point.

Only one SQLite instance can exist at a time, see initialize. Unless documented otherwise, every member of this interface throws IllegalStateException once this instance is closed.

Types

Link copied to clipboard

Provides access to SQLite APIs that do not require SQLite initialization.

Properties

Link copied to clipboard
abstract val ciphers: CipherManager

Registers and configures ciphers used to encrypt database connections.

Link copied to clipboard

Configuration options that can be read or changed at any point during this instance's lifetime, as opposed to the ones only settable through initialize's configure block.

Link copied to clipboard
abstract var hardHeapLimit: Long

Hard limit on the amount of heap memory SQLite may allocate.

Link copied to clipboard
abstract val memoryHighwater: Long

Highest value memoryUsed has reached since the high-water mark was last reset, either through getMemoryStatus or getStatus.

Link copied to clipboard
abstract val memoryUsed: Long

Number of bytes of memory currently allocated by SQLite.

Link copied to clipboard
abstract var softHeapLimit: Long

Soft limit on the amount of heap memory SQLite may allocate.

Link copied to clipboard

Looks up and registers virtual file systems.

Functions

Link copied to clipboard
abstract fun addAutoExtension(autoExtension: AutoExtension)

Registers autoExtension so that it runs against every database connection opened from now on, including ones already open. Has no effect if autoExtension is already registered.

Link copied to clipboard
abstract fun clearAutoExtensions()

Unregisters every AutoExtension previously registered.

Link copied to clipboard
abstract override fun close()

Closes this instance, releasing every global resource SQLite holds. Calling this again on an already closed instance has no effect.

Link copied to clipboard
abstract fun generateRandomBytes(output: Buffer, size: Int)

Fills output with size bytes of randomness. output must hold at least size bytes, writing beyond its capacity is undefined behavior.

Link copied to clipboard

Returns a new ByteArray of size bytes filled with random bytes.

Link copied to clipboard
abstract fun getMemoryStatus(reset: Boolean): Status

Returns memoryUsed and memoryHighwater, resetting the high-water mark afterward if reset is true.

Link copied to clipboard
abstract fun getStatus(option: SqliteStatusOption, reset: Boolean = false): Status

Returns the current value and high-water mark for option, resetting the high-water mark afterward if reset is true.

Link copied to clipboard
abstract fun open(fileName: String, flags: SqliteOpenFlag.Db = SqliteOpenFlag.READWRITE or SqliteOpenFlag.CREATE, vfs: String? = null): DatabaseConnection

Opens the SQLite database at fileName and returns the resulting DatabaseConnection.

Link copied to clipboard
abstract fun releaseMemory(size: Int): Int

Attempts to free up to size bytes of heap memory by discarding non-essential memory SQLite is holding onto, and returns the number of bytes actually freed, which may be less than size.

Link copied to clipboard
abstract fun removeAutoExtension(autoExtension: AutoExtension)

Unregisters autoExtension. Has no effect if it was not registered.