Relix

Language reference

Find an operator

Every operator, predicate and function, with the glyph and keyword forms that reach it. These are the same names the engine's own documentation lookup resolves.

Operators

Joins

Set operations

Aggregates

Predicates

Literals

PageWritten asWhat it does
Datedate '…' date-literal date literal Date literal
Timetime '…' time-literal time literal Time literal
Timestamptimestamp '…' timestamp-literal timestamp literal Timestamp literal
Durationduration '…' duration-literal duration literal interval Duration literal
Array[expr, …] array-construction array construction array Array construction literal
Struct{name: expr} struct-construction struct construction struct Struct construction literal
Truth relationsunit truth-relations truth relation empty dee dum Zero-column truth relations

Language and scripts

PageWritten asWhat it does
Assignment:= assignment Name a relation expression
Sourcesource Declare an external data source
HTTP sourcehttp http-source http source HTTP / JSON data source
Connectionconnection Declare a named database connection
GEDCOM sourcegedcom gedcom-source gedcom source ged Read a GEDCOM genealogy file as individuals and families
Log sourcelog-source log source access log clf Read a web server access log as a typed relation
Namespacenamespace Declare a namespace
Importimport Import definitions from another script
Inline table[| … |] inline-table inline table Literal relation value written inline
Defdef Define a scalar or relation function
Def relationdef relation def-relation tvf Define a relation-valued (table-valued) function
With ordinalitywith ordinality with-ordinality ordinality Attach a row number when unnesting
Relaterelate relationship relationships Declare a named, bounded relationship between two relations
Delimited identifier`name` delimited-identifier delimited identifier backtick quoted-identifier Backtick a name that collides with a reserved word
Comments-- comment comments /* Ignore text: -- to end of line, / … / for a block
Operator spellingsσ / select spellings spelling ascii unicode glyph glyphs syntax Every operator's Unicode glyph and its ASCII equivalent
Grammarebnf grammar bnf The whole language as one EBNF grammar
Relation catalogrelix.relations introspection-relations relations boundedness bounded unbounded row_count relix.relations — every relation the script can name, its kind, size and whether it ends
Introspection stdlibrelix.unused introspection introspection-stdlib relix.deps relix.impact relix.find relix.schema relix.cycles relix.funcs relix.unused / deps / impact / find / schema / cycles / funcs — introspection shipped as Relix
Observability feedrelix.events introspection-events events relix.rules feed relix.events / relix.rules — the previous run's engine decisions, as rows
Component inventoryrelix.version introspection-version version components inventory relix.version — the engine, the facade and every discovered provider, as rows
Candidate keysrelix.keys introspection-keys keys candidate key candidate keys relix.keys — the collected candidate keys of every relation, one row per key column
Reserved namespacerelix.catalog introspection-catalog catalog reserved namespace relix.catalog — the relix.* surface describing itself

Advanced operators

PageWritten asWhat it does
Closureclosure rclosure ⁺ transitive-closure Transitive / reflexive-transitive closure
Clustercluster Partition rows into clusters
Covercover Combinatorial test-suite generation (t-way covering arrays)
Downsampledownsample Reduce row density over a time / numeric axis
Fixpointfix fixpoint General monotone recursion (least fixpoint)
Iterateiterate iteration pagerank convergence Replace-each-round iteration: PageRank, state machines, convergence
Optimizeoptimize LP / ILP declarative optimisation
Pathpath Enumerate shortest / all paths in a graph
Samplesample bernoulli Bernoulli (row-probability) random sampling
Reservoirreservoir reservoir-sample Reservoir (fixed-size) random sampling
Sessionizesessionize Gap-and-island / sessionisation
Solvesolve Constraint solving over a relation
Top-Ktop topk top-k Return top-K rows per group
Tracetrace Diagnostic operator — print rows as they pass through
Optimizeroptimizer optimiser rules rewrites Logical rewrite rules — what fires, when, and how to see it
Pushdownpushdown push-down explain What folds into a backend and what the engine computes

Functions

PageWritten asWhat it does
Lenlen String length
UCaseucase Upper-case
LCaselcase Lower-case
Trimtrim Strip surrounding whitespace
LTrimltrim Strip leading whitespace
RTrimrtrim Strip trailing whitespace
Leftleft Leftmost characters
Rightright Rightmost characters
Midmid Substring
InStrinstr Find substring position
Chrchr Character from code
Ascasc Code of first character
Replacereplace Substitute text
Absabs Absolute value
Intint Floor to integer
Fixfix Truncate toward zero
Roundround Round to nearest
Ceilceil Round up
Sgnsgn Sign
Sqrsqr Square root
Loglog Natural logarithm
Expexp Exponential
Sinsin Sine
Coscos Cosine
Tantan Tangent
Atnatn Arctangent
Powerpower Raise to a power
Randrand Random number
NOWnow Current timestamp
CURRENT_DATEcurrent_date Today
CURRENT_TIMEcurrent_time Current clock time
YEARyear Extract year
MONTHmonth Extract month
DAYday Extract day of month
HOURhour Extract hour
MINUTEminute Extract minute
SECONDsecond Extract second
DATE_TRUNCdate_trunc Truncate timestamp to a unit
MINUTESminutes Measure a duration in minutes
SECONDSseconds Measure a duration in seconds
DAYSdays Measure a duration in days
to_dateto_date Parse a string to a DATE
to_timestampto_timestamp Parse a string to a TIMESTAMP
to_timeto_time Parse a string to a TIME
IIfiif Inline if / conditional value
Nznz Null-to-value
Coalescecoalesce First non-null
IsNullisnull Test for missing value
IsNumericisnumeric Test if value looks numeric
CStrcstr Convert to string
CIntcint Convert to integer
CDblcdbl Convert to number
Entriesentries Read an object's fields as rows