Documentation
¶
Overview ¶
Package driver provides a lightweight database/sql driver for tinySQL.
The driver exposes tinySQL through the standard `database/sql` API and supports both in-memory and file-backed databases. Key features:
- DSN formats: `mem://` and `file:/path/to/db.gob?options` (see `parseDSN`).
- Optional Write-Ahead Log (WAL) and autosave for durability.
- Reader/writer pools and simple MVCC-style snapshots for transactions.
- Simple, safe placeholder binding: sequential `?` and numbered `$1`/`:1`.
Use `sql.Open("tinysql", dsn)` to create a connection. See `applyDSNOption` and `applyQueryOptions` for available DSN options and defaults.
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.