Goal
Define the public query and batch-execution contract required by applications
that use github.com/candango/sqlok.
Context
The core currently exposes SQL AST/compiler pieces plus Mapper and Session
behavior, but application consumers still need a stable public way to execute
filtered lists, joins, aggregates, and batched relationship reads without
copying compiler or executor internals.
Scope
- Define context-aware query execution over caller-owned
*sql.DB and
*sql.Tx boundaries.
- Define row mapping and error behavior for list and empty-result queries.
- Define batch loading/relationship patterns that avoid per-row query fan-out.
- Keep compiler plans, bind buffers, and caches behind the public boundary.
- Add contract tests and documentation before implementation expands.
Non-goals
- Do not mention or depend on a specific downstream application.
- Do not add a global cache or hide transaction ownership.
- Do not import database drivers into the core.
Acceptance criteria
- Public API shape and ownership rules are documented.
- List, empty-result, transaction, mapping-error, and batch-query cases have
executable contract tests.
- The design preserves driver-agnostic execution and leaves dialect-specific
behavior to dialects/adapters.
Goal
Define the public query and batch-execution contract required by applications
that use
github.com/candango/sqlok.Context
The core currently exposes SQL AST/compiler pieces plus Mapper and Session
behavior, but application consumers still need a stable public way to execute
filtered lists, joins, aggregates, and batched relationship reads without
copying compiler or executor internals.
Scope
*sql.DBand*sql.Txboundaries.Non-goals
Acceptance criteria
executable contract tests.
behavior to dialects/adapters.