Skip to content

Creating a virtual table

A virtual table is defined by a module (the implementation that backs it) plus a set of arguments that configure it. The FTS5 module, for instance, creates a full-text search index, and its arguments list the columns to index.

To create a virtual table:

  1. Choose Object → New Virtual Table from the main menu, or New Virtual Table from the tree panel's pop-up menu. This opens the virtual-table editor.

    The virtual table editor The virtual table editor

  2. Enter the table's name, the module name, and the module's arguments.

    The virtual-table editor The virtual-table editor

  3. Click Apply to create it. You can review the generated SQL on the DDL tab.

For example, to create a full-text search table over a title and a body column, use the fts5 module with the arguments title, body. SQLite Expert generates:

CREATE VIRTUAL TABLE documents USING fts5(title, body);

Tip

The modules available to you depend on your SQLite library and any extensions you have loaded. Modules built into most SQLite libraries include fts5, fts4, fts3, and rtree.

See also: Editing a virtual table · Loading and unloading SQLite extensions