Documentation
¶
Overview ¶
Package token provides low-level primitives to represent SQL query fragments in a dialect-agnostic way.
Overview ¶
The token package defines atomic building blocks such as Field, Table, and Join. These tokens are consumed by higher-level builders (e.g. SelectBuilder) to assemble safe, expressive, and auditable SQL statements.
Contracts ¶
All tokens implement a shared set of contracts:
- BaseToken — identity (input, expression, alias, validity)
- Errorable — explicit error state, never panic
- Clonable — safe duplication with preserved state
- Rawable — SQL-generic rendering (expr, alias, owner)
- Renderable — dialect-agnostic String() output
- Stringable — concise diagnostic/logging string
- Ownerable — ownership binding (HasOwner, Owner, SetOwner)
Subpackages ¶
field: represents a column, identifier, or computed expression with aliasing, validation, and diagnostics.
table: represents a SQL source (table or view) used in FROM / JOIN clauses with aliasing and validation support.
join: represents JOIN clauses (INNER, LEFT, etc.) with validation of join kind and conditions.
Supporting modules ¶
resolver: centralizes input type validation and expression resolution (expr, alias, kind) with strict rules and subquery detection.
expression_kind: classifies raw expressions into categories (Identifier, Computed, Literal, Subquery, Function, Aggregate) and validates identifier aliases, including reserved keyword checks.
Roadmap ¶
Future tokens will include:
- conditions (WHERE / HAVING)
- functions (aggregates, JSON, custom expressions)
Contracts will progressively enforce stricter auditability across all tokens.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package condition defines SQL condition tokens used by the Entiqon SQL builder.
|
Package condition defines SQL condition tokens used by the Entiqon SQL builder. |
|
Package field defines the token.Field type, a low-level primitive used by the SQL builder.
|
Package field defines the token.Field type, a low-level primitive used by the SQL builder. |
|
Package helpers provides classification and resolution utilities for SQL token parsing.
|
Package helpers provides classification and resolution utilities for SQL token parsing. |
|
Package token provides primitives to represent SQL JOIN clauses in a dialect-agnostic way.
|
Package token provides primitives to represent SQL JOIN clauses in a dialect-agnostic way. |
|
Package table defines the token.Table type, which represents a SQL table or subquery source with optional alias.
|
Package table defines the token.Table type, which represents a SQL table or subquery source with optional alias. |
|
Package types defines low-level, dependency-free classifications used by SQL tokens.
|
Package types defines low-level, dependency-free classifications used by SQL tokens. |
|
condition
Package condition provides primitives to represent SQL conditional expressions (WHERE, HAVING, ON).
|
Package condition provides primitives to represent SQL conditional expressions (WHERE, HAVING, ON). |
|
identifier
Package identifier provides the classification of SQL expressions into broad syntactic categories such as subqueries, functions, aggregates, literals, and plain identifiers.
|
Package identifier provides the classification of SQL expressions into broad syntactic categories such as subqueries, functions, aggregates, literals, and plain identifiers. |
|
join
Package join provides low-level primitives to represent SQL JOIN clauses in a dialect-agnostic way.
|
Package join provides low-level primitives to represent SQL JOIN clauses in a dialect-agnostic way. |
|
operator
Package operator provides the set of SQL comparison and predicate operators supported by Entiqon condition tokens (WHERE, ON, HAVING).
|
Package operator provides the set of SQL comparison and predicate operators supported by Entiqon condition tokens (WHERE, ON, HAVING). |