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.

FilesystemSource

A folder as a table named 'files', optionally with everything below it. Columns: id, parent_id (empty at the top), depth (0 at the top), name, path, ext, is_dir, size, modified, created, owner, is_readonly and is_hidden. A name starting with '.' counts as hidden. With a scan hint, the costly columns (size, modified, created, owner, is_readonly) are only read when asked for.

Implements: Source

Example

catalog := Catalog->New();
catalog->Load(FilesystemSource->New("results", true));
files := catalog->Get("files");

Operations

ColumnNames # function

Gets the column names

function : ColumnNames() ~ String[]

Return

TypeDescription
Stringcolumn names

GetError #

Gets the reason the last listing failed

method : public : GetError() ~ String

Return

TypeDescription
Stringerror, Nil if none

GetTables #

Gets the table the folder provides

method : public : GetTables() ~ TableSpec[]

Return

TypeDescription
TableSpecone table shape

List #

Lists the folder as a table, with every column

method : public : List() ~ Table

Return

TypeDescription
Tabletable, Nil if the folder cannot be read (see GetError)

List #

Lists the folder as a table, reading only the given columns' costly values

method : public : List(columns:String[]) ~ Table

Parameters

NameTypeDescription
columnsStringcolumns needed

Return

TypeDescription
Tabletable, Nil if the folder cannot be read (see GetError)

List #

Lists the folder as a table, reading only the given columns' costly values

method : public : List(columns:String[], limit:Int) ~ Table

Parameters

NameTypeDescription
columnsStringcolumns needed, Nil for all
limitIntthe most rows to list, -1 for all

Return

TypeDescription
Tabletable, Nil if the folder cannot be read (see GetError)

Load #

Loads the listing 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(root:String, recursive:Bool)

Parameters

NameTypeDescription
rootStringfolder
recursiveBooltrue to include everything below the folder

New # constructor

Constructor

New(root:String, recursive:Bool, max_depth:Int, include_hidden:Bool)

Parameters

NameTypeDescription
rootStringfolder
recursiveBooltrue to include everything below the folder
max_depthIntdeepest level to include, 0 for the folder's own entries, -1 for no limit
include_hiddenBoolfalse to leave out, and not descend into, entries whose names start with '.'

SetName #

Sets the table name

method : public : SetName(name:String) ~ Nil

Parameters

NameTypeDescription
nameStringtable name