db

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckpointWAL added in v0.3.0

func CheckpointWAL(cortexDir string) error

CheckpointWAL runs PRAGMA wal_checkpoint(TRUNCATE) on the given cortex's SQLite database, forcing all pending WAL pages into the main file and truncating the WAL to zero bytes. Used by `noema cortex backup` so the tarball captures a consistent snapshot without a separate -wal sidecar.

This bypasses db.Open's migration runner on purpose: backup is a read- mostly operation and must not upgrade the on-disk schema as a side effect (a v1 cortex should stay at v1 after being backed up). If the database file does not exist yet, the function is a no-op — there is nothing to checkpoint on a cortex that has never been opened.

Types

type DB

type DB struct {
	*sql.DB
}

func Open

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

Jump to

Keyboard shortcuts

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