database

package
v0.0.0-...-2d58d63 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseConnection

func CloseConnection() error

func NewConnection

func NewConnection(ctx context.Context, log zerolog.Logger, dbFilePath string) (*models.Queries, error)

NewConnection establishes a new SQLite database connection and returns a Queries instance. It opens a connection to the SQLite database at the specified file path with foreign keys enabled, verifies the connection is valid by pinging the database, executes the DDL schema to initialize or update the database structure, and returns a Queries instance for executing database operations.

Parameters:

  • ctx: Context for managing the database connection lifecycle and cancellation
  • dbFilePath: File system path to the SQLite database file

Returns:

  • *models.Queries: A queries instance for database operations
  • error: An error if the connection fails, ping fails, or DDL execution fails

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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