sqlite

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(opts ConnectOpts) (*sql.DB, error)

Connect to a SQLite database using the modernc.org/sqlite driver

func ParseConnectionString

func ParseConnectionString(connString string, log *slog.Logger) (parsedConnString string, dbPath string, isMemoryDB bool, err error)

ParseConnectionString parses the SQLite connection string, ensuring the required parameters are set This is optimized for the modernc.org/sqlite driver

Types

type ConnectOpts

type ConnectOpts struct {
	// SQLite database connection string
	// Could be the path to a file, or a URL beginning with "file:"
	ConnString string
	// Optional instance of a slog logger
	// If nil, uses the default slog instance
	Logger *slog.Logger
}

ConnectOpts is the parameters struct for the Connect method

Jump to

Keyboard shortcuts

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