Help us shape the future of Go! Take the 2026 Go Developer Survey

sqliteutil

package
v1.76.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckpointAndClose added in v1.51.0

func CheckpointAndClose(db *sql.DB) error

CheckpointAndClose runs a final WAL checkpoint and closes the database. The TRUNCATE checkpoint folds the -wal file back into the main database so it isn't left behind on disk after shutdown. A checkpoint failure is logged but does not prevent the close.

func DiagnoseDBOpenError

func DiagnoseDBOpenError(path string, originalErr error) error

DiagnoseDBOpenError provides a more helpful error message when SQLite fails to open/create a database file.

func IsCantOpenError

func IsCantOpenError(err error) bool

IsCantOpenError checks if the error is a SQLite CANTOPEN error (code 14).

func OpenDB

func OpenDB(path string) (*sql.DB, error)

OpenDB opens a SQLite database with recommended pragmas for concurrency and foreign key support. It configures the connection pool for serialized writes (MaxOpenConns=1).

Types

This section is empty.

Jump to

Keyboard shortcuts

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