Skip to main content

Module vtab

Module vtab 

Source
Expand description

Create virtual tables.

To create a virtual table, define the virtual table module and then register it on each connection it will be used from. The sqlite3_ext_vtab macro is used to define the virtual table module. It can be registered using Connection::create_module.

There are 3 base types of virtual tables:

  • StandardModule is a virtual table which is created using the CREATE VIRTUAL TABLE command.
  • EponymousModule is a virtual table which is available ambiently in the database connection without being explicitly created.
  • EponymousOnlyModule is similar to EponymousModule, but CREATE VIRTUAL TABLE is explicitly forbidden for these modules.

In addition to the base type of virtual table, there are several traits which can be implemented to add behavior.

  • VTab is required to be implemented by all virtual tables.
  • CreateVTab indicates that the table supports CREATE VIRTUAL TABLE.
  • UpdateVTab indicates that the table supports INSERT/UPDATE/DELETE.
  • TransactionVTab indicates that the table supports ROLLBACK.
  • FindFunctionVTab indicates that the table overrides certain SQL functions when they operate on the table.
  • RenameVTab indicates that the table supports ALTER TABLE RENAME TO.

Structs§

ChangeInfo
Information about an INSERT/UPDATE/DELETE on a virtual table.
ColumnContext
Describes the run-time environment of the VTabCursor::column method.
EponymousModule
Describes an eponymous virtual table.
EponymousOnlyModule
Declare an eponymous-only virtual table.
IndexInfo
Information about a query plan.
IndexInfoConstraint
IndexInfoConstraintIterator
IndexInfoOrderBy
IndexInfoOrderByIterator
StandardModule
Declare a virtual table.
VTabConnection
A wrapper around Connection that supports configuring virtual table implementations.
VTabFunctionList
A collection of methods overloaded by a virtual table.

Enums§

ChangeType
Indicates the type of modification that is being applied to the virtual table.
ConflictMode
Indicates the ON CONFLICT mode for the SQL statement currently being executed.
ConstraintOp
DistinctMode
Describes the requirements of the virtual table query.

Traits§

CreateVTab
A non-eponymous virtual table that supports CREATE VIRTUAL TABLE.
FindFunctionVTab
A virtual table that overloads some functions.
Module
A virtual table module.
RenameVTab
A virtual table that supports ALTER TABLE RENAME.
TransactionVTab
A virtual table that supports ROLLBACK.
UpdateVTab
A virtual table that supports INSERT/UPDATE/DELETE.
VTab
A virtual table.
VTabCursor
Implementation of the cursor type for a virtual table.
VTabTransaction
Implementation of the transaction type for a virtual table.

Type Aliases§

DisconnectResult