storage

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckExisting

func CheckExisting(path string) error

CheckExisting verifies that an existing SQLite database can answer a simple query without creating, migrating, or backing it up.

Types

type Config

type Config struct {
	Driver Driver
	Path   string
}

Config selects a storage adapter and location.

type Driver

type Driver string

Driver names a storage adapter.

const (
	// DriverSQLite stores project data in a local SQLite database.
	DriverSQLite Driver = "sqlite"
	// DriverPostgres reserves the future PostgreSQL adapter seam.
	DriverPostgres Driver = "postgres"
)

type Handle

type Handle interface {
	HealthCheck() error
	Close() error
}

Handle is the storage boundary used by application services.

type Store

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

Store is a local project database handle.

func Initialize

func Initialize(path string) (*Store, error)

Initialize opens or creates a SQLite database and applies migrations.

func Open

func Open(config Config) (*Store, error)

Open opens a storage adapter from config.

func (*Store) Close

func (s *Store) Close() error

Close closes the underlying database handle.

func (*Store) HealthCheck

func (s *Store) HealthCheck() error

HealthCheck verifies that the database can answer a simple query.

Jump to

Keyboard shortcuts

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