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.

ObjectSource

The program's own objects as a table: one row per object, one column per function that reads a value from an object. Each function's return type sets its column's type.

Implements: Source

Example

source := ObjectSource->New("runs", runs)<Run>;
source->AddString("name", \(Run) ~ String : (r) => r->GetName());
source->AddFloat("score", \(Run) ~ Float : (r) => r->GetScore());
source->AddInt("epochs", \(Run) ~ Int : (r) => r->GetEpochs());
catalog := Catalog->New();
catalog->Load(source);

Operations

AddBool #

Adds a Bool column

method : public : AddBool(name:String, reader:(T)~Bool) ~ ObjectSource<T>

Parameters

NameTypeDescription
nameStringcolumn name
reader(T)~Boolreads the value from an object

Return

TypeDescription
ObjectSource<T>this source

AddDate #

Adds a Date column; a Nil date is an empty cell

method : public : AddDate(name:String, reader:(T)~Date) ~ ObjectSource<T>

Parameters

NameTypeDescription
nameStringcolumn name
reader(T)~Datereads the value from an object

Return

TypeDescription
ObjectSource<T>this source

AddFloat #

Adds a Float column

method : public : AddFloat(name:String, reader:(T)~Float) ~ ObjectSource<T>

Parameters

NameTypeDescription
nameStringcolumn name
reader(T)~Floatreads the value from an object

Return

TypeDescription
ObjectSource<T>this source

AddInt #

Adds an Int column

method : public : AddInt(name:String, reader:(T)~Int) ~ ObjectSource<T>

Parameters

NameTypeDescription
nameStringcolumn name
reader(T)~Intreads the value from an object

Return

TypeDescription
ObjectSource<T>this source

AddString #

Adds a String column; a Nil string is an empty cell

method : public : AddString(name:String, reader:(T)~String) ~ ObjectSource<T>

Parameters

NameTypeDescription
nameStringcolumn name
reader(T)~Stringreads the value from an object

Return

TypeDescription
ObjectSource<T>this source

GetError #

Gets the reason the last load failed

method : public : GetError() ~ String

Return

TypeDescription
Stringerror, Nil if none

GetTables #

Gets the table the objects provide

method : public : GetTables() ~ TableSpec[]

Return

TypeDescription
TableSpecone table shape

Load #

Loads the objects into a catalog

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

Parameters

NameTypeDescription
catalogCatalogcatalog
hintScanHintcolumns and rows needed, Nil for everything

Return

TypeDescription
Booltrue if loaded

New # constructor

Constructor

New(name:String, objects:Vector<T>)

Parameters

NameTypeDescription
nameStringtable name
objectsVector<T>objects, one per row

ToTable #

Reads the objects into a table

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

Parameters

NameTypeDescription
hintScanHintcolumns and rows needed, Nil for everything

Return

TypeDescription
Tabletable