Skip to main content
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 get SELECT, 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 the FROM 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_match are unranked: score is present (for schema uniformity) but constant 0.0, and order is unspecified, so use ORDER 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.

See also

Last modified on July 6, 2026