v2026.11.2
All Bundles
Bundle

In-memory query engine over typed columns. Tables are filled row by row or loaded from sources (CSV files, folders, the program's own objects) and queried with SQL-like statements; aggregates, Describe() and Finder (file search) are included. Compile with -lib query.

RemoteSource

A table published by a TableServer (in the query_server library) on another machine, read as if it were local. Queries go to the server's /query endpoint as SQL, and results come back as .otab, so every type and empty cell arrives exactly. Load sends only the columns and row limit the scan hint asks for, and the condition given to SetWhere, so only the rows a query needs cross the network; the server applies them, and the local query applies its own WHERE again, so pushing a condition down never changes an answer.

Implements: Source

Example

runs := RemoteSource->New("http://lab-server:8090", "runs");
runs->SetWhere("score > 0.9");
catalog := Catalog->New();
if(catalog->Load(runs)) {
  catalog->Query("select label, count(*) from runs group by label")->ToCsv()->PrintLine();
};

Operations

GetError #

Gets the reason the last request failed

method : public : GetError() ~ String

Return

TypeDescription
Stringerror, Nil if none

GetTables #

Gets the table's shape, by asking the server for none of its rows

method : public : GetTables() ~ TableSpec[]

Return

TypeDescription
TableSpectable shapes, Nil on error (see GetError)

Load #

Loads the table into a catalog under its name

method : public : Load(catalog:Catalog, hint:ScanHint) ~ Bool

Parameters

NameTypeDescription
catalogCatalogcatalog
hintScanHintcolumns and rows needed, Nil for everything

Return

TypeDescription
Booltrue if loaded, false on error (see GetError)

New # constructor

Constructor

New(base:String, name:String)

Parameters

NameTypeDescription
baseStringserver address, such as 'http://localhost:8090'
nameStringpublished table's name

Query #

Runs a SELECT on the server, over any of the tables it publishes

method : public : Query(statement:String) ~ Table

Parameters

NameTypeDescription
statementStringSQL SELECT

Return

TypeDescription
Tableresult, Nil on error (see GetError)

Read #

Reads the table, or the part of it the hint and SetWhere ask for

method : public : Read(hint:ScanHint) ~ Table

Parameters

NameTypeDescription
hintScanHintcolumns and rows needed, Nil for everything

Return

TypeDescription
Tabletable, Nil on error (see GetError)

Read #

Reads the whole table, or the part SetWhere asks for

method : public : Read() ~ Table

Return

TypeDescription
Tabletable, Nil on error (see GetError)

SetWhere #

Sets a condition for the server to apply before sending rows, as SQL after WHERE

method : public : SetWhere(condition:String) ~ Nil

Parameters

NameTypeDescription
conditionStringcondition, such as "score > 0.9 and label = 'cat'"; Nil for none