Skip to main content

Module bridge

Module bridge 

Source
Expand description

§SQL Execution Bridge

Unified SQL execution pipeline that routes all SQL through a single AST.

§Architecture

┌─────────────┐     ┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   SQL Text  │ --> │   Lexer     │ --> │   Parser    │ --> │    AST      │
└─────────────┘     └─────────────┘     └─────────────┘     └─────────────┘
                                                                   │
                    ┌──────────────────────────────────────────────┘
                    │
                    v
┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  Executor   │ <-- │  Planner    │ <-- │  Validator  │
└─────────────┘     └─────────────┘     └─────────────┘
      │
      v
┌─────────────┐
│   Result    │
└─────────────┘

§Benefits

  1. Single parser: All SQL goes through one lexer/parser
  2. Type-safe AST: Structured representation of all queries
  3. Dialect normalization: MySQL/PostgreSQL/SQLite → canonical AST
  4. Extensible: Add new features by extending AST, not string parsing

Structs§

ScopeDefinition
A stored scope definition (from DEFINE SCOPE).
SqlBridge
Unified SQL executor that routes through AST
StoredTablePermissions
Stored per-table permission rules (from DEFINE TABLE … PERMISSIONS).

Enums§

ExecutionResult
Execution result types

Traits§

SqlConnection
Storage connection trait for executing SQL against actual storage