sqlite

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package sqlite is the SQLite and local-filesystem storage backend: mirror.db for every record store, a content-addressed blob directory, and audit.jsonl, all under one store root.

Index

Constants

View Source
const Name = "sqlite"

Name is the storage.backend value that selects this backend.

Variables

This section is empty.

Functions

func Backend

func Backend() storage.Backend

Backend is the SQLite backend as a registered value.

func BlobsDir

func BlobsDir(root string) string

BlobsDir is the directory the store under root keeps artefact bytes in.

func DatabasePath

func DatabasePath(root string) string

DatabasePath is the database file of the store under root.

func Exists

func Exists(root string) bool

Exists reports whether a store has been initialised under root. Only an absent database reads as false; any other stat failure is left for the open to report.

func LedgerPath

func LedgerPath(root string) string

LedgerPath is the append-only assurance log of the store under root; the log's own reader names it, so the writer and the reader cannot disagree.

func Migrations

func Migrations() []sqlitestore.Migration

Migrations returns every migration the binary knows about, in apply order. Its length is the binary's expected schema version, so the CLI and the public façade open mirror.db against an identical schema.

func Open

func Open(req storage.Request) (*storage.Storage, error)

Open opens the store under req.StoreRoot and returns every store over it.

The database is opened without migrations, judged, then migrated, because schema_migrations is keyed on (module, version): a store from a newer build reads as fully applied, so its unknown rows are the only signal. A write intent applies nothing to such a store and Writable refuses it; a read intent still opens it, so an operator can diagnose the refusal.

IntentInspect applies no migration, creates no ledger and runs no maintenance, so the schema state it reports is the store as found; it refuses a root with no database.

Types

type Settings

type Settings struct{}

Settings is the sqlite section of config.yaml. It has no keys: every path the backend uses derives from the store root.

func (Settings) ConfigComment

func (Settings) ConfigComment() string

ConfigComment is the explanation `config init` writes under the section.

Jump to

Keyboard shortcuts

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