dat0
dat0
.dat0 format · v1 (draft)

§3 Chunk 02 — QUERIES

One query, any source — join a Parquet file on disk to a live Postgres table in a single query, no ETL. The QUERIES chunk keeps the saved questions. Designed, not shipped.

QUERIES0x0312

In development. This format is designed, not shipped. Nothing to install yet — join the waitlist.

Files and databases are the same thing to dat0. One SQL query can span a Parquet file on disk and a live Postgres table at once — nothing to import first, no pipeline to build. You point at the sources and ask the question across all of them. The QUERIES chunk is where the questions live: name, SQL text, and the source bindings each was written against — the concept story keeps 3 saved.

The same query, any source

The query barely changes when the source does. A scan over a local Parquet, a scan over a CSV, and a join into a live Postgres table are the same shape — only the source clause differs:

SELECT country, count(*) AS events
FROM 'events.parquet'
GROUP BY country
ORDER BY events DESC;
SELECT c.plan, count(*) AS events
FROM 'events.parquet' e
JOIN postgres_scan('host=db user=app', 'public', 'customers') c
  ON c.id = e.user_id
GROUP BY c.plan
ORDER BY events DESC;
SELECT country, count(*) AS events
FROM 'events.csv'
GROUP BY country
ORDER BY events DESC;

Why it matters

No ETL, no staging tables, no waiting for a load to finish. The file on your disk and the table in your database meet in one query, on your machine, the moment you ask. That removes the slowest part of most analysis: getting everything into one place before you can even start.

The chunk

Hex dump of the start of the QUERIES chunk. It opens with four bytes spelling QUER, its payload length, an encoding byte selecting the saved-query list, and the start of the first entry — a query name, then its SQL text, then its source bindings.

Each saved query is stored with the bindings it was written against, so a replayed artifact re-points the same SQL at the same sources — or at new ones you choose. The question survives the handoff intact.

Continue to §4 Chunk 03 — SESSION.

On this page