This is the coordination page for query work in timeless-libsql.
The feature maps are the source of truth for what the storage extension can do,
what the Rust signal APIs compose from those primitives, and what deliberately
belongs in a higher-order Timeless library.
- PromQL feature matrix
- LogsQL feature matrix
- SQL equivalents for query-language features
- Query/storage findings
- Shipped-row conformance references
- Pinned semantic oracles
- Query evidence protocol
- Sequential implementation plan
- Final query and public-surface release report
- SQL query cookbook
The baseline represented by the first version of these maps is commit
a72634e on 2026-08-04. Exact source and container versions live in the
oracle contract. Upstream language references are
snapshots, not a claim that every upstream feature belongs in this project:
Every matrix row has one primary target. A feature can use several layers, but only one layer owns its public semantics.
| target | responsibility |
|---|---|
EXT |
A public SQLite/libSQL virtual table, scalar function, hidden-column contract, pruning rule, or packed result. Use this only when storage awareness materially avoids reads, decode, copies, or cross-boundary rows. |
API |
Parsing, AST validation, query planning, expression evaluation, result shaping, cancellation, and Prometheus/Victoria-compatible HTTP behavior in the Rust signal server. |
SQL |
Composition that ordinary SQLite already expresses well. Document and test the executable statement in the SQL equivalents cookbook instead of adding a special extension API. The Rust API may generate this SQL. |
LIB |
Application behavior: saved queries, recording/alert rules, subscriptions, live tail, dashboards, scrape-target administration, token issuance, cluster policy, or UI state. These belong in timeless_metrics, timeless_logs, timeless_traces, TimelessUI, or another higher-order consumer. |
DEFER |
The feature requires a data type or storage identity that Timeless does not retain, is experimental upstream, or has not earned its implementation cost. The row must say why. |
PromQL and LogsQL syntax do not belong in the extension. The extension is a general SQLite/libSQL storage and query accelerator. The Rust APIs own language compatibility and lower expressions onto public SQL/extension primitives. A direct SQLite user can use those same primitives without starting a Timeless HTTP server.
| status | meaning |
|---|---|
shipped |
Parses, executes, is documented, and has a semantic regression test against real extension storage. |
partial |
Some syntax or execution path exists, but the matrix names missing semantics. |
in progress |
A temporary working-branch state: the failing oracle exists and implementation is underway. It must become shipped, return to its prior state, or be documented as deferred before release. |
missing |
Not implemented in the Rust data plane. An implementation may already exist in an Elixir library and serve as a porting oracle. |
experimental |
Deliberately not shipped by default while upstream semantics or the product cost/benefit remains experimental. The row names the decision and reconsideration trigger. |
deferred |
Deliberately not scheduled until the recorded prerequisite or product decision changes. |
library |
Intentionally remains a higher-order library concern. |
shipped is intentionally strict. A parser test alone is not completion, and
an HTTP response assembled from a fake store is not storage parity.
Query work proceeds one matrix row at a time. Closely related rows may share a commit only when they are one grammar/evaluator primitive and cannot be tested honestly in isolation.
- Select one
missingorpartialrow and change it toin progressin the working branch. - Add the smallest conformance fixture that distinguishes the required semantics, including empty, boundary, invalid, and cancellation cases.
- Run it against the current Rust API and record the expected failure before implementation.
- Implement at the row's target layer. Never add an extension primitive just to avoid writing an ordinary SQL expression.
- Test direct SQLite/libSQL behavior for every new or changed
EXTprimitive. For everySQLtarget or foundation, add the equivalent parameterized statement to the SQL equivalents cookbook, state what language semantics still belong to the API, and execute the statement through the real extension with the Rusttimeless-query-harness. If no honest public SQL equivalent exists, change the ownership classification. - Test the Rust parser, planner, evaluator, HTTP envelope, and reopen behavior
for every
APIfeature. - Compare PromQL with Prometheus/VictoriaMetrics or LogsQL with VictoriaLogs when an upstream semantic oracle exists. Record intentional differences.
- Measure completed work, p50/p95/p99, result cardinality, bytes read/decoded, response bytes, cancellation, and RSS HWM on a representative narrow and wide fixture. Performance does not decide correctness, but it decides whether pushdown is justified.
- Add the public example and error behavior to the relevant user guide.
- Update the matrix row to
shippedand append any surprising storage behavior to the findings log in the same commit.
If an approach fails, keep the regression fixture, document the result, revert the failed implementation, and continue with an independent row.
- Restore known product parity. Port the established
timeless_metricsPromQL behavior and the establishedtimeless_logsLogsQL/DDNet grammar before adding novel compatibility. - Complete storage-native cores. Prioritize selectors, time bounds, exact/indexed filters, counters, aggregations, sorting, pagination, and discovery that can exploit existing indexes and packed frames.
- Complete language composition. Add vector matching, label transforms, logical filters, pipelines, and response transformations in the Rust APIs.
- Optimize only from evidence. Promote work into
EXTonly after query measurements show that SQL/API composition pays an avoidable storage or decode cost. - Revisit deferred types and higher libraries. Native histograms (which the capability document explicitly reports as unsupported), log stream identity, subscriptions, rules, and UI workflows are separate decisions after the storage/query contract is stable.
A timeless-libsql release must publish the matrices as they were tested. CI
must reject a shipped row without its named conformance coverage and reject
server documentation that advertises a smaller or larger surface than the
matrix. A shipped row that names SQL must link its executable cookbook
recipe. Higher-order Timeless releases should link to the exact
timeless-libsql version's maps rather than restating a drifting query list.