db

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSqliteDB

func NewSqliteDB(opts ...SqliteOption) (*sqlx.DB, error)

NewSqliteDB creates a new sqlx.DB with the provided options

Types

type SqliteOption

type SqliteOption func(*config)

SqliteOption defines a function that configures the DB

func WithConnMaxLifetime

func WithConnMaxLifetime(d time.Duration) SqliteOption

WithConnMaxLifetime sets the maximum lifetime of a connection

func WithMaxIdleConns

func WithMaxIdleConns(n int) SqliteOption

WithMaxIdleConns sets the maximum number of idle connections

func WithMaxOpenConns

func WithMaxOpenConns(n int) SqliteOption

WithMaxOpenConns sets the maximum number of open connections

func WithPath

func WithPath(path string) SqliteOption

WithPath sets the path for the SQLite database Use ":memory:" for an in-memory database

func WithPragmas

func WithPragmas(pragmas string) SqliteOption

WithPragmas sets custom pragmas for the SQLite connection This replaces the default pragmas

Jump to

Keyboard shortcuts

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