dbio

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDB

func CloseDB(db *sql.DB, dbPath string)

CloseDB closes the database and removes the temp file without writing output.

func OpenDB

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

OpenDB reads a serialized sqlite database from stdin (if piped) or creates a fresh one, ensures the standard schema exists, and returns an open *sql.DB along with the temp file path. The caller must call OutputDB or CloseDB when done.

func OutputDB

func OutputDB(db *sql.DB, dbPath string) error

OutputDB writes the database to stdout if piped, or prints a message to stderr if stdout is a terminal. It closes the database and removes the temp file in all cases.

func ZeroFill

func ZeroFill(a string, size int) string

ZeroFill left-pads a string with zeros to the given size.

Types

This section is empty.

Jump to

Keyboard shortcuts

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