VirtualTableModule

Virtual Table Module.

This interface is not directly implementable, one of Regular, Eponymous or EponymousOnly must be implemented depending on the virtual table kind.

optionalFunctions must list every optional VirtualTable function the produced tables implement, since SQLite decides which callbacks exist for this module as a whole, once, before any table is created or connected to. A function listed here that the produced VirtualTable does not override throws VirtualTableOptionalFunctionNotImplementedError the first time SQLite calls it.

Note that a VirtualTableModule cannot be a singleton nor a reusable instance — a new instance must always be passed to DatabaseConnection.createModule.

Inheritors

Types

Link copied to clipboard
abstract class Eponymous(optionalFunctions: Set<VirtualTableOptionalFunction> = emptySet()) : VirtualTableModule

Eponymous Virtual Table. The same callback reference is passed to SQLite for both create and connect.

Link copied to clipboard
abstract class EponymousOnly(optionalFunctions: Set<VirtualTableOptionalFunction> = emptySet()) : VirtualTableModule

Eponymous Only Virtual Table. A callback is passed to SQLite for connect but not for create.

Link copied to clipboard
abstract class Regular(optionalFunctions: Set<VirtualTableOptionalFunction> = emptySet()) : VirtualTableModule

Regular Virtual Table. Distinct callbacks are passed to SQLite for create and connect.

Properties

Functions

Link copied to clipboard
open override fun close()

Called when the module is finalized by SQLite. Finalization can also happen when the module registration fails.

Link copied to clipboard

Connects to an already created virtual table and returns the VirtualTable instance. If an error is detected, an SQLiteException is thrown and is returned to SQLite.