Skip to content

SQL Overview

xcon-db executes a time-series subset of SQL. Standard SQL is accepted at the interface; anything outside the subset gets a clean error instead of a slow surprise. There is no general relational optimizer and there are no joins — leanness lives in what the engine refuses to execute.

Statements

Statement Purpose
CREATE TABLE Declare a table, its channels and policies
INSERT Append rows (fragments welcome)
SELECT Range scans, LATEST ON, ordering, limits
SAMPLE BY Downsampling with FILL(PREV\|NULL\|LINEAR)
DELETE Tombstone an entity (mutable tables)
CHECKPOINT Seal for backup
SHOW TABLES List tables

Literals & durations

  • strings: single quotes, '' escapes — 'door ''open'''
  • numbers: 42, -3.5
  • NULL, true/false (booleans are just 1/0 — the type system is f64+string)
  • durations: <number> [ms|s|m|h|d]60 s, 90 d, bare numbers are milliseconds
  • -- starts a comment

WHERE

Exactly two predicates exist, combined with AND:

  • entity = '<string>'
  • ts comparisons: >=, >, <=, <, =, BETWEEN a AND b (ts is Unix milliseconds)

That is not a placeholder for a future expression engine; value predicates belong in your code or your dashboard tool.