commondb

package
v1.2.89 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package commondb owns the process-wide SQLite connection lifecycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalPath

func CanonicalPath(path string) (string, error)

func CloseAll

func CloseAll() error

func DSNForOS

func DSNForOS(path string, windows bool) string

DSNForOS returns the configured SQLite file URI. It is exported for platform-specific integration tests.

func Open

func Open(path string, migrate Migrator) (*sql.DB, error)

func OpenStandalone

func OpenStandalone(path string, migrate Migrator) (*sql.DB, error)

OpenStandalone opens an uncached connection for tools that explicitly own its lifecycle, such as offline integrity checks.

func Query

func Query(path string, migrate Migrator, fn func(*sql.DB) error) error

func Write

func Write(ctx context.Context, path string, migrate Migrator, fn func(*sql.Tx) error) error

Types

type Migrator

type Migrator func(*sql.DB) error

Jump to

Keyboard shortcuts

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