Skip to Content
New EngineLoad DataIn-Memory Tables

In-memory tables are useful for examples, smoke tests, and small local checks. They are held by the REPL session and are not persisted when the process exits.

Create table

CREATE TABLE metrics ( id BIGINT, value DOUBLE, ok BOOLEAN, label TEXT );

Supported CREATE TABLE shape:

CREATE TABLE name ( column_name TYPE, ... );

IF NOT EXISTS and OR REPLACE are handled by the REPL. Storage options, constraints, defaults, primary keys, and external table options are not supported for this local table form. Use CREATE TABLE name AS SELECT ... for materialized query results. CTAS executes through the engine statement path and stores the result as a session-local ordinal-keyed table.

Insert rows

INSERT INTO metrics VALUES (1, 10.5, true, 'train'), (2, 12.0, false, 'eval');

You can provide a column list:

INSERT INTO metrics (id, label, value, ok) VALUES (3, 'test', 11.25, true);

Only literal VALUES input is supported. INSERT ... SELECT, conflict handling, RETURNING, and other insert options are not supported.

Query

The SQL REPL starts with SpiralDB selected as the default catalog. In-memory REPL tables live in the memory catalog.

SELECT * FROM memory.metrics;

Supported types

SQL familyStored type
INT, BIGINT, and related integer aliasesI64
REAL, FLOAT, DOUBLEF64
BOOL, BOOLEANboolean
CHAR, VARCHAR, TEXT, STRINGUTF-8 text

Integer, floating-point, and boolean columns accept NULL. Text columns do not currently accept NULL in the REPL materializer.

In-memory tables are materialized to temporary Vortex data before execution, so they use the same scan path as file-backed tables once registered.

Keys

In-memory tables use the ordinal key. The current REPL does not declare column keys on in-memory tables.

Last updated on