dbutil

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureDB

func ConfigureDB(sqlDb *sql.DB) (*sqlx.DB, error)

ConfigureDB sets up common database configuration

func EscapeLike added in v1.3.2

func EscapeLike(s string, prefix bool, suffix bool) string

EscapeLike escapes SQL LIKE/ILIKE wildcard characters (%, _, and \) in a string and optionally adds prefix/suffix wildcards for pattern matching.

func Get

func Get(ctx context.Context, db sqlx.Ext, q sq.SelectBuilder, dest interface{}) error

Get runs a query and reads results into dest.

func OpenDB

func OpenDB(url string) (*sqlx.DB, error)

func OpenDBPool

func OpenDBPool(ctx context.Context, url string) (*pgxpool.Pool, *sqlx.DB, error)

func OpenPool

func OpenPool(ctx context.Context, url string) (*pgxpool.Pool, error)

func OpenRedis

func OpenRedis(v string) (*redis.Client, error)

func Select

func Select(ctx context.Context, db sqlx.Ext, q sq.SelectBuilder, dest interface{}) error

Select runs a query and reads results into dest.

Types

This section is empty.

Jump to

Keyboard shortcuts

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