Verisyntax — User Manual (prototype 0.1)

Recipe: join customers and orders

The included <example-project> project turns two CSV files into typed SQLite tables and combines them with a type-checked join.

database local:
  engine sqlite
  path "customer_orders.sqlite"

source customers:
  database local
  table "customers"
  column id: integer from "customer_id"
  column name: text
  column country: text
  primary_key id
  provenance row

source orders:
  database local
  table "orders"
  column id: integer from "order_id"
  column customer_id: integer
  column total: real
  column status: text
  primary_key id
  provenance row

dataset paid_customer_orders:
  from customers as customer
  inner join orders as order on customer.id = order.customer_id
  select customer.name as customer_name
  select customer.country as country
  select order.total as order_total
  where order.status = "paid"
  1. Open <example-project>, open customer_orders.vsx, and click Check.
  2. Initialize metadata for database local.
  3. Select source customers and import customers.csv with create; review three rows.
  4. Select source orders and import orders.csv with create; review four rows.
  5. Select paid_customer_orders, then click Compile C++, Build native, and Run.

The result contains Customer A with 125.5 and Customer C with 200.0. Customer B's order is pending, and Customer A's second order is refunded, so both are filtered out. Both sources use the same database; Verisyntax does not perform a hidden cross-database join.