Skip to Content

Use in-memory tables for examples, reproductions, and small local checks. They are session-local: they exist only inside the current REPL session.

Create a table

CREATE TABLE runs ( run_id BIGINT, model TEXT, score DOUBLE, passed BOOLEAN );

The REPL supports simple column definitions for in-memory tables. Constraints, primary keys, generated columns, storage options, and external table options are not supported for this local table form. Use CREATE TABLE name AS SELECT ... to materialize a query result into an in-memory table.

Insert rows

INSERT INTO runs VALUES (1, 'baseline', 0.72, true), (2, 'rerank', 0.81, true), (3, 'ablation', 0.65, false);

You can also provide an explicit column order:

INSERT INTO runs (run_id, model, passed, score) VALUES (4, 'fast-path', true, 0.78);

INSERT accepts literal VALUES rows only. It does not insert from a query.

Query the table

The SQL REPL starts with SpiralDB selected as the default catalog. Local REPL tables live in the memory catalog, so qualify them in SQL queries:

SELECT model, score FROM memory.runs WHERE passed ORDER BY score DESC LIMIT 5;

In-memory tables are materialized into temporary Vortex data before execution, so query execution goes through the same scan path as file-backed tables.

Use VALUES without creating a table

Use a VALUES query when you only need a literal relation:

VALUES (1, 'train'), (2, 'eval');

VALUES columns are named column1, column2, and so on:

VALUES (1, 'train'), (2, 'eval');

Derived tables are not bound yet, so create an in-memory table when you need to filter, group, or rename literal rows.

Inspect table metadata

.tables .schema runs

.tables shows the table kind, size, and key. In-memory tables use the ordinal key.

Last updated on