Documentation
¶
Overview ¶
Package driver implements a database/sql driver for tinySQL.
What: A minimal driver that exposes tinySQL via the standard database/sql interfaces. It supports in-memory databases (mem://) and file-backed persistence (file:path?options) with optional WAL and autosave. How: A small server wrapper manages a storage.DB and concurrency via reader and writer pools. Connections create snapshots for transactions (MVCC-light) and serialize writes through a WAL when configured. Placeholders (?) are bound by simple string substitution with proper literal escaping. Why: Integrating with database/sql enables familiar APIs, tooling, and portability while keeping the implementation small and self-contained.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenInMemory ¶ added in v0.5.1
OpenInMemory returns a *sql.DB backed by an in-memory tinySQL server. If tenant is empty the default tenant is used.
func SetDefaultDB ¶
SetDefaultDB allows external code to provide a storage.DB instance that will be used by the driver when opening connections. This is useful for embedding environments (WASM) that want to keep a reference to the underlying DB.
Types ¶
This section is empty.