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 implemented only if the VirtualTableModule that instantiated a VirtualTable returned the function F when VirtualTableModule.optionalFunctions was called. Otherwise, the function F do not need to be implemented and is guaranteed to never been called by SQLite.

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

The errMsg is internally filled with the SQLiteException's message when one is thrown by a function. So unless the implementation do not want to deal with exceptions, it is not required to fill it.

The nRef and errMsg properties must only be accessed from within one of the methods listed in VirtualTable. So it is illegal to access these fields in one of VirtualTableModule methods as an example.

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

This method is used by SQLite to determine the best way to access the virtual table.

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)

Saves the current state to id.

Link copied to clipboard
open fun sync()

Starts a two-phase commit.

Link copied to clipboard

Updates the virtual table and returns the newly inserted rowid or null if no rowid must be returned to SQLite.