Documentation
¶
Overview ¶
Package db implements the database runner: it runs a SQL statement from a `query:` step through a named db runner and captures the result — rows (for a SELECT) as a JSON array, or the affected-row count (for INSERT/UPDATE/DDL) — as a runner.Result (ADR-0026). It is the atago counterpart to runn's DB runner. Only pure-Go drivers are linked in (no cgo): SQLite via modernc.org/sqlite, PostgreSQL via lib/pq, MySQL via go-sql-driver/mysql.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateDriver ¶
ValidateDriver reports whether an explicitly declared runner.driver is one of the supported names/aliases. It is meant for the loader, which wants to reject a bad driver before execution begins; an empty driver is always valid because it is inferred from the dsn at resolution time.
Types ¶
type Config ¶
type Config struct {
// Driver is a database/sql driver name: sqlite, postgres, or mysql.
Driver string
// DataSource is the driver-specific DSN (path for sqlite, URL/native for the
// servers).
DataSource string
// Timeout bounds a single query; zero means no timeout.
Timeout time.Duration
}
Config is the resolved configuration for a db runner.