Changelog
0.1.14, 6 November 2026
distillql review CONTEXT --browseropens a review page on 127.0.0.1. It puts first the terms that need a person (read more than one way, failing a check, or missing their business values), then groups the rest by table with one Approve per table. Each term opens its evidence in place: the past query it came from, the readings to pick between, and the row filters the history leaves off. Save writes approve, edit and strike decisions underterms:in the context file. Agents then read approved and edited terms as verified and no longer see struck ones, and a new crawl keeps every decision.
0.1.13, 5 November 2026
- Trino, and Starburst, as an engine:
kind: trino, one Trino catalog per engine, installed withpip install 'distillql[trino]'. Each query carries the person's name as its Trino user, so Trino's access rules, row filters and column masks apply to them. A person signs in with a password, a JWT or OAuth, or the crawler login sends their name and Trino's impersonation rules decide.current_useris read back, and a query that ran as anyone else is refused. Table functions that pass text to the database underneath, such aspostgresql.system.query, are refused. The crawl reads tables, comments, row counts and the coordinator's recent queries, andhistory:files. Tested on a local Trino 484 server; the SQL subset matches DuckDB in all 18 conformance cases. - The crawl tags columns that hold personal data with their kind (email, phone, name, government id, address, birth date, payment card or bank account, IP address, credential), from the column's name or from most of its sampled values, and keeps none of their values.
distillql reviewlists them,search_contextnames them for each table, anddistillql asksends a model none of their values unlessllm.send_columnslets one through. search_contextnames the words of a question that no table, column, value, comment or term in the context uses, so an agent can say the data does not answer instead of answering from a stand-in. It stays quiet on a table that withholds its values.- The
querytool adds a note when a query filters a text column on a value the column does not hold, naming the column's values, a case match or the closest one. It uses the crawl's value list, or at most two small lookups when an empty result has none.
0.1.12, 28 October 2026
- A query on a BigQuery engine can read a dataset's
INFORMATION_SCHEMAviews (TABLES,COLUMNS,COLUMN_FIELD_PATHS,TABLE_OPTIONS,PARTITIONS,VIEWS, key and constraint views,ROUTINES,PARAMETERS), writtendataset.INFORMATION_SCHEMA.COLUMNSin any case or with the project in front. BigQuery runs it as the person asking, and its columns are checked like a table's. Only the engine's own datasets, and only these views:JOBSand the other region and project views hold other people's query text and are refused with the reason, as is a join with another engine. On the Spider 2.0 pilot agents wrote 38 such queries in 25 of 90 runs, and every one failed. - A table name of four or more parts read in DuckDB's dialect was never checked against the catalog and went to the engine as written. It is now refused with the reason.
0.1.11, 28 October 2026
- A BigQuery engine over many tables opens faster:
connectreads 32 tables at a time, with a connection pool to match, where it read 8 (700 tables: 7 s, from 21 s). A large context file loads with libyaml's parser when PyYAML has it (a 40 MB crawl: 16 s, from 66 s); the file it writes is unchanged byte for byte. Together they kept the tool server from starting inside 30 s on the Spider 2.0 pilot's largest tasks. - BigQuery wildcard tables work:
`dataset.events_*`with a_TABLE_SUFFIXfilter is one table over the dataset's tables whose names start withevents_, with their columns and_TABLE_SUFFIX. The query goes to BigQuery as written, under the dry run andmaximum_bytes_billedas before, and the explain record names the pattern and how many tables it matched. A wildcard table joined with another engine's table is refused with the reason. Before, every such query was an unknown table. - BigQuery's name rules hold on BigQuery engines: table and column names match in any case, dataset names keep theirs, and a
GROUP BYorORDER BYname that is also a SELECT-list alias means the alias. Before,Sales.ordersforSales.Ordersfailed the column check, as didgroup by patientIdwhere two joined subqueries both hadpatientIdin some case. Postgres and DuckDB keep their rules. - A table named as BigQuery names it,
`bigquery-public-data.dataset.table`, resolves to the engine whoseprojectthat is. Before, it was refused with a parse error. - A table with no columns (BigQuery keeps one made without a schema) no longer stops every query on its engine from planning.
- Found by the Spider 2.0-Lite pilot on BigQuery (
evals/spider2/): the gold SQL of all 30 pilot tasks now runs through DistillQL and gives the same rows as BigQuery alone; before these fixes none did.
0.1.10, 27 October 2026
- The dbt reader is checked on dbt Labs' jaffle-shop built with dbt-bigquery: 20 of its 23 metrics are imported, as on DuckDB, and all 20 give MetricFlow's value or, for the median MetricFlow will not compute exactly on BigQuery, the definition's own SQL. A median or percentile metric was written as
PERCENTILE_CONT(0.5) WITHIN GROUP (...), which BigQuery rejects. It is now the exact window function, orAPPROX_QUANTILESwhen the metric setsuse_approximate_percentile;use_discrete_percentilenow givesPERCENTILE_DISCon every engine, where it gavePERCENTILE_CONT. Table names in a metric's SQL are quoted where the dialect needs it (BigQuery'sorder-linesorrows).distillql gapsdrafts a metric from aCOUNTIF(BigQuery) orcount_if(DuckDB) in the history, where it said "its expression is not one aggregate".
0.1.9, 27 October 2026
- BigQuery's cost guard is checked on large public tables. The crawl no longer bills without limit: it sampled a view with
select * ... limit 5000, which bills every column in full (2.6 TB oncrypto_bitcoin.transactions), and read a large table's date range with amin/maxquery over the whole column. Both are now dry-run first and skipped over the newcrawl_bytes_billedkey (default 1 GB), with a note. A query whose dry run is overmaximum_bytes_billedis refused before any job starts, and every refusal gives the estimate. The newbilling_projectkey runs and bills jobs in your own project while the tables come from another, such asbigquery-public-data. The explain record shows each part's estimated bytes beside the bytes billed, and their sum undercost.
0.1.8, 27 October 2026
- The crawl closes on Postgres the leak 0.1.7 closed on BigQuery. It sampled tables with row-level security as the crawl's login saw them, often every row, and read columns that some roles may not select. Now a table with row-level security enabled, forced or not, keeps its schema and no values, and a column that some role holding SELECT on part of its table may not select is never read. On Postgres and BigQuery alike, past queries stay in the history with their shape and run counts: a value compared against a column a row policy filters on, or a guarded column, becomes
$1, and the notes count them. The crawl reads a policy's columns from itsUSINGexpression or filter predicate; where it cannot, every value on that table is masked. A query is left out only when it cannot be parsed. The notes also say when the crawl's Postgres login bypasses row-level security. On the eval's insurance_complex and saas_complex databases the drafted pages are unchanged line for line. This replaces 0.1.7's rule on BigQuery, which left out every past query holding a value on a guarded table and so dropped definitions that never named a guarded value.
0.1.7, 27 October 2026
- The crawl keeps nothing in the shared context that a person could not read in BigQuery. It read as the crawler and kept a tagged column's values, a row-restricted table's values and ranges, and past queries holding those values, which another person's agent could find through
search_context. Now a table with row access policies keeps its schema and no values, a column with a policy tag is never read, and past queries keep only parameters for those values (see the Postgres line above). The explain record names each table's row policies and policy tags. - A second BigQuery person can sign in by impersonating a service account (
{impersonate: <service account>}), with no key file. A person without the Storage Read API permission gets rows through the REST API instead of an error. - A query that joins a Postgres table with a BigQuery table is tested live: each side runs as the person asking with its own filters, columns and the other side's keys, and the rows match the query run on Postgres alone. Postgres NUMERIC values arrive as decimals instead of text, which broke sums across engines; whole-number keys go to the other engine as integers; the explain record names the keys sent to Postgres; a BigQuery query over
maximum_bytes_billedreaches an agent asover_cap.
0.1.6, 27 October 2026
- BigQuery is tested on a live project and no longer warns that it is experimental. The crawl reads each table's description, keys, row count and policy tags through the API, which bills nothing. The query history groups the project's jobs by query text with their run counts, keeps cached runs, leaves out DistillQL's own jobs, and falls back to the person's own jobs without the project-wide permission. A query runs as one job (the identity check no longer bills a second), is checked as read-only first, and stops at
maximum_bytes_billedwith a clear refusal. A person's credentials can be a credentials object, an OAuth token or a service-account file.
0.1.5, 27 October 2026
- The crawl reads DataHub and OpenMetadata, over their APIs or from a saved file of their responses: the engine's
datahub:andopenmetadata:keys. Glossary terms (with OpenMetadata's synonyms and metrics) go under "Documented by your team" with the tables and columns they are linked to; a linked column says "Business term: ..." where search reads it; descriptions fill in tables and columns that have none; saved queries on the engine's tables join the query history. Checked against the DataHub 1.7 and OpenMetadata 2.0.5 quickstarts, and run as a company runs them, with sign-in on, on DataHub 1.8.0 and OpenMetadata 2.0.6. - Metrics the crawl drafts from history keep the whole expression inside the aggregate:
sum(price*qty)was drafted assum(price)andcount(distinct id)ascount(id). Column names with spaces are quoted, so the drafted SQL runs. On SQLShare, a public log of about 9,000 real queries, this removed 44 wrong metrics and fixed 87; on the eval's 36 test companies it removed about 4% of drafted metric suggestions, all of them wrong, and left the drafted glossary page unchanged. - A subquery's columns are no longer credited to a table whose alias the subquery reuses, which drafted joins and metrics that do not exist (68 joins and 2 metrics on SQLShare).
- A DuckDB engine reads its whole
history:file. It read only the first 500 lines and said nothing. - The crawl reads queries built with EXCEPT, INTERSECT or a bracketed SELECT, and dropped them before. History it cannot parse is still skipped, and the crawl's notes now say how many.
- A dollar amount inside a string (
'$500') no longer counts as a value the server log hides.
0.1.4, 18 October 2026
- The MCP server sends the glossary page as its instructions, which an agent's app keeps in its system prompt; agents then call
glossaryonly for a term the page cuts or lacks. Claude Code keeps instructions up to 4,096 characters, so the page is cut at a line to about 4,000 and says so. On 90 eval questions, Claude Opus calledglossary0.41 times a question instead of 1.03, took one turn fewer, and answered as many right. - Tool results reach the agent as plain text. With the MCP library's structured output on, Claude Code handed the model
{"result": "<the result, escaped>"}: every quote and newline escaped. Results are also compact JSON, without the indentation the library added. queryover MCP leaves out the explain record, which was about 80% of a result and changed no answer;profile(handle, op="explain")returns it, andTools.query(..., explain=False)does the same in Python.search_contextsays each thing once: no empty fields, scores to two places, a term's one reading folded into its run count, a reviewed query shown with its values only, and a table note or closest entry left out where another hit already carries it. Together these cut what an agent reads from the tools by about 30% and its cost per right answer by 14% to 18% on Claude Haiku and Opus, with as many right answers.
0.1.3, 16 October 2026
- The LookML reader writes measures over joins that repeat rows, as Looker's symmetric aggregates count them: where a one_to_many join repeats a view's rows, its sums and averages add each row once by the view's primary key.
sum_distinctandaverage_distinctadd eachsql_distinct_keyvalue once. Still left out and named in the notes: a sum of one view's values once per row of another, and a measure of a view reached many_to_one, which counts only that view's rows the join reaches (in the eval, a loss ratio's earned premium lost the months with no claims). A filter with a leading minus on a number field ("-6") is read as Looker reads it, minus six, and the term's description says so, since on text fields the same minus means "not". - The Ossie reader imports a metric that combines a joined dataset's value with each row's own (
SUM(INVOICES.amount * FX_RATES.usd_per_unit), a plan's seats for each active subscription), and the term says the joined value is read once per row. It had refused these as double counting. An aggregate of the joined dataset's columns alone is still left out. - The Ossie reader joins on a relationship column that is a field (
ISSUED_MONTH, a month computed from a date) by reading the field's expression, and reads a field that names its own dataset (GRADES.submission_idin a field ofGRADES) on the metric's table. Both failed on Postgres before. - The LookML reader puts a
numberparameter's value into SQL unquoted, as Looker does (+ {% parameter grace_days %}became+ '0', which Postgres rejects next to a date). - Search ranks a table higher when the question names one of its yes/no columns ("paid channels" and
channels.is_paid), and its hit says to keep only the rows where the column is true. Before, a word in a column name counted no more than the same word inside a value (paid_search), and the table could miss the top five. Search also ignores "each", "every", "was", "were", "did", "does" and "are", which matched definitions at random. - A term two semantic layers define the same way (dbt and Ossie, LookML and dbt) is one reading that names both: the page adds "(dbt and Ossie agree)" and counts both layers. Before, the second layer's name was dropped, so the page could not say they agree. Where they differ, both readings show, as before.
- The LookML reader fills manifest constants everywhere, filter values included (
filters: [status: "-@{cancelled}"]), readsNOT NULLandNULLfilters on every field type, and no longer counts a table function in a derived table (generate_series(...)) as a missing table. On the eval's LookML projects for 36 companies, measures left out fell from 187 to 98. lookml:on an engine reads a LookML project's folder, with no Looker instance. Measures become verified terms, written as Looker writes their SQL for the explore with the measure's view as its base: filters inside the aggregate,sql_always_where, joined views' fields, derived tables as subqueries. Each model reads only the files its includes name; constants, refinements,extendsand${EXTENDED}are merged; Liquid is read with Looker's defaults, and the term says so. Dimensions give columns their descriptions and other names; primary keys andmany_to_onejoins become keys and joins. A measure that needs symmetric aggregates, a relative date or a user attribute is named in the crawl's notes. On the jaffle-shop sample on Postgres, 22 of 22 measures match dbt's metrics or direct SQL.ossie:on an engine reads an Apache Ossie semantic model (dbt'starget/osi_document.json, a Snowflake semantic view's export, or any file in the 0.1.1 or flat 0.2 shape). Metrics become verified glossary terms, with filters on other datasets joined through the document's relationships; synonyms become the terms' other names; descriptions, keys and joins fill the crawl. On 36 test companies, 761 of 762 metrics give the same number as the same dbt metrics read from the semantic manifest.distillql glossary --ossie FILEwrites the glossary's single-table measures as an Ossie semantic model (0.1.1 by default, or--ossie-version 0.2, which passes the spec's schema), with each table's primary key and the joins between the tables. dbt 1.12.6 cannot query metrics it loads from an Ossie file, sodistillql gaps --yamlstays the way to hand dbt its missing metrics.- Every query DistillQL sends ends with the comment
/* distillql */, and the crawl leaves those out of the history and counts them in its notes. Before, a crawl after people had used DistillQL counted its own profiling and agents' queries as people's runs, so a definition looked more used each time. Queries that read no table (select current_user) are left out too. - An Ossie metric that names a field computing a value (
SUM(orders.amount_cents)over a fieldamount * 100) is read as that expression. It was read as a column the table lacks, and the query failed. - The crawl leaves out the queries dbt runs for its tests (the ones it names
dbt_internal_test), which drafted terms calledfailuresandshould_warn. - A
history:file now also fills adate_truncunit thatpg_stat_statementsreplaced with$1, and a query that reads no table (a driver'sselect $1) no longer counts as one whose values are hidden.
0.1.2, 15 October 2026
distillql askanddistillql.ask()answer a question with any model that speaks OpenAI's chat-completions API: Ollama or LM Studio on this machine, or a cloud model the config allows. DistillQL runs the tool loop itself, so no AI app is needed. Only the config's newllm:section can loosen its limits: this machine only unlessallow_hostsnames another (https, no redirects, no proxies); keys from the environment only; nowritetool; at mostmax_rowsrows a result (default 20), or none withsend_rows: false; personal columns and anything computed from them, other than counts, held back; a log of every request without rows or keys.distillql askworks properly with reasoning models such as gpt-oss: it sends each reply's reasoning back with the next request, caps a reply atllm.max_output_tokens(default 8,192) and stops cleanly when one is cut off, leaves temperature to the server unlessllm.temperaturesets it (temperature 0 made gpt-oss repeat itself until the cap), and takesllm.reasoning_effort. It sends a model that answers before running any query back once, and returns the query that produced the asked columns, not a check run after it;Answer.querieslists every query.ask()also accepts a config as a dict and an open connection.- The glossary drafts the populations other terms share (rows that pass the same filters, or are live on a date, counted per entity), keeps ratios as terms of their own, adds the unweighted base of a weighted average, and marks a term that filters on today's status as a current snapshot.
- Drafted terms carry plain-language aliases (
wa_becomes "weighted average"), marked inferred. An ad-hoc term computing a standing report's number becomes its second reading. A drafted term that repeats a documented one is marked superseded. - Lifecycle filters say how often the history applies them when counting the entity and when joining it for an attribute.
- Deduplication steps (
DISTINCT ON,ROW_NUMBER() = 1) stay in a term's line; the page legend defines every join word it uses. - The crawl notes quantity columns in mixed units and whether an amount is before or after tax, as inferred column notes.
- "Undefined terms: none" prints only after the question's words are checked; otherwise the page lists the missing words and the closest terms.
- A term the question names is never cut from the page, and comes with the comment that defines it and its period.
querytakesexpect_columnsand names extra or missing columns. A filter a term's own line lacks is named with the term it came from.search_contextranks an entity's own table first for its attributes, marks a column several tables hold as two readings, and notes that a status beside a date range is the row's final outcome.- The same query history drafts the same page in every process: populations and lifecycle lines with equal counts are ordered by name.
0.1.1, 14 October 2026
dbt:on an engine reads a dbt project'starget/folder. MetricFlow metrics become verified glossary terms, model and column descriptions fill in missing comments, and dbt tests mark keys, joins and allowed values. No dbt install or account is needed.distillql gapscompares an imported dbt project with the query history. It lists numbers the history computes that dbt does not define, dbt metrics people compute with other conditions, and dbt metrics no query uses.--yamlwrites the missing numbers as MetricFlow metrics where one table and one aggregate state them. The crawl notes the count and puts the queries behind each missing number first in the review queue.- A glossary term that few queries use now points to the established reading of the same measure, when another reading has at least twice its use:
cost_per_milefrom a few ad-hoc queries defers tocost_per_loaded_milefrom the regular ones.
Security
- Postgres refuses functions that act outside the read-only transaction under every login, including your own login and the connector's:
dblink_exec, file and large-object functions, advisory locks,set_config,nextvaland others.allow_functionscan name one to allow it. caps.timeout_secondsstops a query that runs too long, on each engine and in the local join.caps.result_rowscuts a result to its first rows and says how many were cut. The agent tools default to 60 seconds and 100,000 rows.- The local DuckDB no longer reads files or reaches the network unless
local_files: true. A DuckDB file that exists opens read-only unlessread_only: false. - Text from the database (column comments, dbt descriptions, documented terms, long sample values) reaches the agent inside « », marked as data. SQL comments are left out of the queries the glossary and
search_contextshow. distillql mcp --httpprints a pairing code per approval request, beside the site the approval sends you back to, and the approval page names that site. Five wrong codes end that request only. Pending requests, clients and tokens are capped.initwrites the config readable by you alone from the start, and moves a password out of a URI's query string.writemakes files readable by you alone. Errors no longer show local paths to the agent. An SSH destination cannot be read as an option.- The release workflow pins each action to a commit and publishes from the
testpypiandpypienvironments.
Fixes
- Mixed-case Postgres columns plan correctly. Write them as Postgres needs them, in double quotes; an unquoted
customeridagainst"CustomerId"is refused with that hint. - A dbt ratio or derived metric keeps its own
filter:. A metric whose filter cannot be written as SQL, or whose input is undefined, is skipped with a note instead of stopping the crawl. metric('name')is refused in a SELECT that does not read the metric's own table.- Repeated queries get references of 12 hex digits (
shape_3fa1c09b2e7d), so two never share one. A decision made under an old five-digit reference carries over. - The crawl notes the tables it skips past 200 and profiles the ones the history uses most.
- Query history is credited to the right table when names are mixed case or a name is in two schemas.
- A query across engines names its columns as the same query on one DuckDB engine would.
ResultHandle.sqlreplaces only the table namedself; the cache reads each engine's own syntax; history files acceptcalls: nulland$$bodies.
0.1.0
The first release.
- One engine over DuckDB and Postgres: SQL names tables as
engine.schema.table, each fragment runs on its engine as the user, and DuckDB joins the pieces. - The explain record: each fragment, the identity each engine saw, the policies applied, pushdown, column lineage and cost.
- Row and byte caps checked against each engine's estimate before a query runs.
- A crawl that profiles tables and mines query history into drafted definitions, a glossary page and a review queue.
- Six agent tools, as Python functions and over MCP with
distillql mcp. distillql demo, a sample shop that runs every command with no server.distillql initsets up a database in one command: it tests the login, keeps the password where you choose (system keychain, environment variable, a command such as a secret manager or a cloud sign-in token, a prompt,~/.pgpass, or the config), crawls, and adds DistillQL to Claude Code.distillql checksays what is missing. The Postgres login can also come frompg_service.conf, thePG*variables, or an open psycopg or SQLAlchemy connection (Postgres.from_connection).- Postgres over TLS with certificate checks and client certificates, as libpq takes them, and through an SSH jump host (
ssh:), using the system's ownsshand the user's keys. history:files (JSON lines or.sql) for any DuckDB or Postgres engine. On Postgres they fill in the valuespg_stat_statementshides as$1.distillql mcp --http, for apps that connect by URL such as ChatGPT and Claude on the web, behind a sign-in approved with a pairing code.- Snowflake, BigQuery and Databricks connectors, experimental: not yet run against a live account.