Skip to main content

Module sql

Module sql 

Source
Expand description

SQL connector trait (3-method surface) + dialect enum.

Phase 83 shipped a minimized 2-method MVP (dialect() + schema_text()) to AVOID OSSIFYING the public API before any real connector validated the contract. Phase 84 (CONN-01) ships the full 3-method trait surface, adding SqlConnector::execute now that the per-backend connectors validate the shape:

  • execute(sql, &[(String, Value)]) -> Result<Vec<Value>, ConnectorError> returns one JSON object per row — the exact shape MCP transport needs at the tools/callstructuredContent boundary (D-01).
  • Parameters are a slice of named (name, value) pairs so the caller controls bind order and they round-trip cleanly through serde_json (D-03).

Streaming and transactions remain deferred to a future semver-additive release (D-02) — see SqlConnector for the evolution plan.

Phase 83’s TKIT-10 prompt assembly calls SqlConnector::schema_text only, never execute(), so the additional method does not change that surface.

Re-exports§

pub use translate::translate_placeholders;
pub use translate::TranslatedSql;
pub use sqlite::SqliteConnector;

Modules§

sqlite
First-class SQLite connector (CONN-08), gated behind the sqlite feature.
translate
Dialect-aware placeholder translation (CONN-03).

Enums§

ConnectorError
Errors a SqlConnector impl may surface from SqlConnector::schema_text or SqlConnector::execute.
Dialect
Supported SQL dialects (4-variant per spike 005).

Traits§

SqlConnector
Three-method SQL connector trait — Phase 84 ships the full trait surface.