storage

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package storage wraps modernc.org/sqlite with baifo-specific tables and schema versioning. One file lives under .baifo/data/baifo.db.

Index

Constants

View Source
const (
	// SchemaVersion is the current on-disk schema version, written to the
	// meta table on every Open() call.
	SchemaVersion = "1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB wraps a sql.DB instance with baifo-specific accessors.

func Open

func Open(dir string) (*DB, error)

Open opens or creates baifo.db inside <dir>/data/. The data subdirectory is created if missing. All tables are ensured to exist.

func (*DB) Close

func (db *DB) Close() error

Close closes the underlying database.

func (*DB) SQL

func (db *DB) SQL() *sql.DB

SQL exposes the underlying *sql.DB.

Jump to

Keyboard shortcuts

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