Files
Baradb/src/barabadb/query/exec
dimgigov 8db5cfe7e1
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
feat: harden storage, schema persistence, fair benches, fix wire crash
Core storage: hash MemTable, WAL group commit, L0 compaction rebuild,
reader-writer lock, and a global StorageGate so HTTP workers and TCP
share the LSM safely under multi-thread access.

Schema: durable CREATE/ALTER/DROP under _schema:tables:* with full LSM
restore on open. Executor types/values/schema split into query/exec/.

Wire protocol: switch default MM to ARC — ORC cycle collector segfaulted
after ~20 async INSERTs. Fair multi-tier benchmarks (SQLite/HTTP/wire/PG)
and honesty docs for mixed-tier comparisons.
2026-07-18 16:55:50 +03:00
..

Executor package (query/exec/)

The original executor.nim was a ~5.8k-line god object. Shared pieces live here; ../executor.nim remains the main execution engine and re-exports this package so existing import barabadb/query/executor keeps working.

Modules

Module Responsibility
types.nim ExecutionContext, TableDef, Row, ExecResult, …
values.nim Null/string conversion, row payload parse/escape, SQL escapes
schema.nim Durable catalog (_schema:tables:*), restore, index rebuild

Import rules

  • No cycles: types → nothing in exec/; valuestypes; schematypes + values.
  • executor.nim imports all three and exports them.
  • Prefer adding new shared helpers under exec/ instead of growing executor.nim.

Sensible next extractions (not done yet)

  1. dml.nimexecScan / execInsert / execUpdate / execDelete (needs eval/triggers hooks)
  2. rls.nim — row-level security + privileges
  3. lower.nim — AST → IR (lowerExpr / lowerSelect)
  4. plan_exec.nim — IR plan walker / window functions
  5. hybrid.nim — hybrid vector+FTS search helpers

Keep statement dispatch (executeQueryImpl) in executor.nim until those land.