goquestorage

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package goquestorage provides task storage implementations for different database backends.

Index

Constants

View Source
const (
	// PgDriver is the legacy lib/pq driver name. goque does not
	// register "postgres" itself — callers using this constant must
	// `_ "github.com/lib/pq"` in their own code.
	//
	// Deprecated: lib/pq is in maintenance mode. Use PgxDriver for
	// new code; the storage layer works identically with either.
	PgDriver = "postgres"
	// PgxDriver is the pgx/v5 stdlib driver name. Registered by
	// this package; recommended for new code.
	PgxDriver = "pgx"
	// PgxV5Driver is the alternative name pgx/v5/stdlib registers
	// itself under (alongside "pgx"). Accept both so callers using
	// either form via sqlx.Open hit the same code path.
	PgxV5Driver = "pgx/v5"
	// MysqlDriver represents the MySQL database driver.
	MysqlDriver = "mysql"
	// SqliteDriver represents the SQLite database driver (mattn/go-sqlite3).
	SqliteDriver = "sqlite3"
)

Database driver constants. Values are the names under which the underlying drivers register themselves with database/sql.

Variables

This section is empty.

Functions

func NewDBConn

func NewDBConn(ctx context.Context, cfg *Config) (*sqlx.DB, error)

NewDBConn creates a new database connection with configured settings.

Types

type Config

type Config struct {
	DSN             string
	Driver          string
	MaxOpenConn     int
	MaxIdleConn     int
	ConnMaxLifetime time.Duration
	ConnMaxIdleTime time.Duration
}

Config holds the configuration parameters for database connection settings.

Jump to

Keyboard shortcuts

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