This document describes the supported subset of SQL (the project’s dialect) and limitations.
- String literals: single quotes
'...'. - Identifiers: Latin letters/digits/
_(see the lexer for details). - Semicolons
;are allowed and recommended in interactive mode.
Currently supported:
INT64— 64-bit integerVARCHAR— variable-length string
Syntax:
CREATE TABLE table_name (
col1 TYPE,
col2 TYPE,
...
);Example:
CREATE TABLE users (id INT64, name VARCHAR, age INT64);Syntax:
INSERT INTO table_name VALUES (value1, value2, ...);Example:
INSERT INTO users VALUES (1, 'Alice', 25);Syntax:
SELECT targets FROM table_name [WHERE predicate];Supported:
*(all columns)- a list of expressions:
col,col1 + col2,price * 2 - aliases:
expr AS alias WHEREpredicates withAND/OR- comparisons:
=,!=,<,>,<=,>=
Examples:
SELECT * FROM users;
SELECT id, name FROM users WHERE id > 10 AND age <= 30;
SELECT name, age + 1 AS next_age FROM users WHERE name != 'Bob';Syntax:
CREATE INDEX index_name ON table_name(column_name) USING type;Where type is:
HASH— for point lookups (predicate=)BTREE— for ranges (<,<=,>,>=) and point lookups (seeINDEXES.md)
Example:
CREATE INDEX idx_users_id ON users(id) USING HASH;Not supported in the current version:
UPDATE,DELETEDROP TABLE,DROP INDEXJOIN,GROUP BY,ORDER BY,LIMIT- transactions and a full concurrency model
See ROADMAP.md for the up-to-date plan.