An in-process engine. Syntax is SQLite-ish.
WASM: https://dawdmaow.github.io/odinsql/
- Query:
SELECT … FROM … [JOIN …]* [WHERE …] [GROUP BY …] [HAVING …] [ORDER BY …] [LIMIT …] [OFFSET …]. - DML:
INSERT INTO … [(cols)] VALUES (rows…),UPDATE … SET … [, …] [WHERE …],DELETE FROM … [WHERE …]. - DDL:
CREATE TABLE [@COLUMNAR] … (columns… [, PRIMARY KEY(col)]),CREATE INDEX name ON table (col),ALTER TABLE … ADD COLUMN …,RENAME COLUMN … TO …,DROP COLUMN …,DROP TABLE [IF EXISTS] …. - Transactions:
BEGIN,COMMIT,ROLLBACK.
- Projections:
*, qualified names, expressions (arithmetic, unary-), optionalAS/ implicit aliases. - Joins:
INNER/JOIN,LEFT JOIN,RIGHT JOIN,CROSS JOIN;ONjoin condition; table/column aliases. - Subqueries:
IN (SELECT …), derived tables(SELECT …) AS alias, including nestedINand innerORDER BY/LIMIT. - Aggregates:
COUNT(*)/COUNT(expr),SUM,AVG- withGROUP BY,HAVING. - Not implemented
SELECT DISTINCT,UNION, window functions,CASE.
- Comparisons:
=,<>,!=,<,>,<=,>=. - Boolean combos:
AND,OR,NOT(with precedence). - Sets / ranges:
IN (…),NOT IN,BETWEEN,NOT BETWEEN. - String matching:
LIKE/NOT LIKEwith SQL%and_wildcards (not full POSIX/regex). - Literals: integers, floats, single-quoted strings (with escaping rules),
NULL,TRUE,FALSE.
- Declared types:
INTEGER/INT,FLOAT/DOUBLE/REAL,BOOL/BOOLEAN,TEXT/STRING. - Primary key required per table.
NOT NULLon column definitions where supported byCREATE/ALTER.DROP TABLE IF EXISTS.
- Unique index on PK;
CREATE INDEXbuilds a non-unique B+ tree on one column. - Planner can use PK or secondary indexes for selective
WHEREand for index-backedORDER BYon PK or indexed columns when the query allows.
./build_wasm.shpython -m http.server 8000odin test . -sanitize:address -debug