query_sql runs SQL across every table in the catalog. It is read-only: use it to
filter, aggregate, and join your rows, and to run Infino’s search table functions
(BM25, vector, hybrid, and exact/token match) as relations you compose with SQL. Mutate
data with append / update / delete (see Tables), not SQL.
Dialect
Infino executes SQL on Apache DataFusion. The dialect is ANSI-style and Postgres-leaning. You getSELECT, WHERE, JOIN (across tables), CTEs (WITH),
GROUP BY with aggregates, window functions, ORDER BY, LIMIT, and the usual
scalar/aggregate functions.
Search table functions
Call a search function in theFROM clause as a relation. Every one takes a leading
table-name argument (a string literal naming the catalog table to search) and returns that
table’s _id, its scalar columns, and a score column. The ranked functions
order by relevance, so add ORDER BY score DESC (and a LIMIT) for control.
mode(BM25, token):'or'(default, match any term) or'and'(require all terms).vector: the query embedding, as a comma-separated string literal ('0.12,0.04,-0.31,...') or a SQL array literal ([0.12, 0.04, -0.31, ...]).token_match/exact_matchare unranked:scoreis present (for schema uniformity) but constant0.0, and order is unspecified, so useORDER BY/LIMIT.
Examples
Composing search with SQL
Each function returns a relation, so you can filter, join, and aggregate over its results:SQL is read-only.
INSERT / UPDATE / DELETE / CREATE are not available; create
tables and mutate rows through the API (create_table, append, update, delete).
For a pushdown text pre-filter on vector search (rather than a SQL post-filter), see the
filter option in the Search guide.