VirtualTable

abstract class VirtualTable : SqliteVtab(source)

Represents a Virtual Table.

This interface declares the mandatory functions required by SQLite as well as the optional ones. An optional function F must be overridden only if it is listed in the VirtualTableModule.optionalFunctions of the VirtualTableModule that instantiated this VirtualTable. Otherwise F does not need to be overridden and is guaranteed to never be called by SQLite.

If an error is detected in a mandatory or optional function, it is allowed to raise an SQLiteException that is then reported to SQLite.

errMsg is automatically filled with the thrown SQLiteException's message, so setting it manually is only needed when not relying on exceptions to report errors.

nRef and errMsg can only be accessed from within one of this VirtualTable's own methods, not from a VirtualTableModule method such as VirtualTableModule.connect.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
override var errMsg: String?
Link copied to clipboard
override val nRef: Int

Functions

Link copied to clipboard
open fun begin()

Begins a transaction.

Link copied to clipboard

Called by SQLite to determine the most efficient way to access the virtual table for a given query, described by info.

Link copied to clipboard
open fun commit()

Commits the transaction.

Link copied to clipboard
abstract fun destroy()

Releases the connection to the virtual table and destroys the backing store, if any.

Link copied to clipboard
abstract fun disconnect()

Releases the connection to the virtual table without destroying the backing store, if any.

Link copied to clipboard

Returns a ScalarFunction that overrides the global one identified by name and argumentCount. If the function should not be overridden, then null is returned.

Link copied to clipboard
open fun VirtualTableIntegrityScope.integrity(schema: String, tableName: String, flags: Int)

Verifies the integrity of the content stored in the virtual table.

Link copied to clipboard
abstract fun open(): VirtualTableCursor

Creates a new cursor for accessing the virtual table.

Link copied to clipboard
open fun release(id: Int)

Invalidates all savepoints >= id.

Link copied to clipboard
open fun rename(newName: String)

Renames the virtual table to newName.

Link copied to clipboard
open fun rollback()

Rollbacks the transaction.

Link copied to clipboard
open fun rollbackTo(id: Int)

Restores the state to what it was when savepoint was called with id, invalidating all savepoints >id.

Link copied to clipboard
open fun savepoint(id: Int)

Records a savepoint identified by id.

Link copied to clipboard
open fun sync()

Starts a two-phase commit.

Link copied to clipboard

Applies an INSERT, UPDATE or DELETE described by arguments to the virtual table. Returns the rowid of the newly inserted row, or null if none should be reported to SQLite. Conflict resolution and unchanged-column information are available through the receiver VirtualTableUpdateScope.