driver

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

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

func OpenInMemory(tenant string) (*sql.DB, error)

OpenInMemory returns a *sql.DB backed by an in-memory tinySQL server. If tenant is empty the default tenant is used.

func SetDefaultDB

func SetDefaultDB(db *storage.DB)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL