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
Click to show internal directories.
Click to hide internal directories.