Code Completion¶
Code completion helps you write SQL faster and with fewer mistakes, by suggesting valid elements as you type and by expanding short abbreviations into full statements.
Completion suggestions¶
Press Ctrl+Space in the SQL editor to open a resizable hint window listing the elements you can insert at the cursor. Select one to add it to your code.
What is offered depends on where the cursor is — SQLite Expert reads the statement you are writing and suggests only what would be valid at that point:
- table, view, index and trigger names, and the names of attached databases;
- column names, taken from the tables the statement refers to;
- SQL keywords and commands, data types, collation and savepoint names;
- pragma names, after
PRAGMA. The list comes from the SQLite library in use rather than from the application, so it stays right as SQLite changes and follows whichever library you have loaded. Pragmas SQLite has deprecated, and those it provides only for debugging, are left out. - function names, wherever an expression is allowed. Every function the current connection knows about is listed, which includes the SQLite built-ins and any function added by a loaded extension — load an extension and its functions start appearing immediately. Function names are not offered where a column is being declared rather than referred to, such as the column list of a
CREATE TABLE.

Automatic completion is on by default. You can adjust it under Tools → Options → Code Completion:
- With Auto Invoke enabled, typing a dot (
.) opens the completion window automatically. The Delay setting controls how long SQLite Expert waits before showing it (0–10000 milliseconds). - Ctrl+Space always opens completion, even when Auto Invoke is turned off.
Code templates¶
Templates expand a short abbreviation into a full SQL skeleton. Type the abbreviation in the SQL window and press Ctrl+J to expand it. For example, typing ssf and pressing Ctrl+J replaces it with the SELECT * FROM template:
The following predefined templates are available:
atr = ALTER TABLE RENAMEata = ALTER TABLE ADD COLUMNan = ANALYZEad = ATTACH DATABASEbt = BEGIN TRANSACTIONct = COMMIT TRANSACTIONci = CREATE INDEXcui = CREATE UNIQUE INDEXcrt = CREATE TABLEcta = CREATE TABLE ASctt = CREATE TEMPORARY TABLEctta = CREATE TEMPORARY TABLE ASctbd = CREATE TRIGGER BEFORE DELETEctbi = CREATE TRIGGER BEFORE INSERTctbu = CREATE TRIGGER BEFORE UPDATE OFctad = CREATE TRIGGER AFTER DELETEctai = CREATE TRIGGER AFTER INSERTctau = CREATE TRIGGER AFTER UPDATE OFctid = CREATE TRIGGER INSTEAD OF DELETEctii = CREATE TRIGGER INSTEAD OF INSERTctiu = CREATE TRIGGER INSTEAD OF UPDATE OFfer = FOR EACH ROWcv = CREATE VIEWcvt = CREATE VIRTUAL TABLErt = ROLLBACK TRANSACTIONdf = DELETE FROMdd = DETACH DATABASEdt = DROP TABLEdi = DROP INDEXdtr = DROP TRIGGERdv = DROP VIEWet = END TRANSACTIONex = EXPLAINie = IF EXISTSine = IF NOT EXISTSpg = PRAGMAre = REINDEXrs = RELEASE SAVEPOINTrts = ROLLBACK TO SAVEPOINTscf = SELECT COUNT FROMssf = SELECT * FROMsv = SAVEPOINTut = UPDATE TABLEvc = VACUUM
See also: Executing SQL scripts