database

package
v0.0.0-...-e100621 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFilterString

func BuildFilterString(filters map[string][]string, allowedFilters map[string]string) string

BuildFilterString ...

func Log

func Log(query string, args ...interface{}) string

Log provides a pretty print version of the query and parameters.

func NamedQuerySlice

func NamedQuerySlice(ctx context.Context, db *sqlx.DB, query string, data interface{}, dest interface{}) error

NamedQuerySlice is a helper function for executing queries that return a collection of data to be unmarshaled into a slice.

func Open

func Open(cfg Config) (*sqlx.DB, error)

func StatusCheck

func StatusCheck(ctx context.Context, db *sqlx.DB) error

Types

type Config

type Config struct {
	User         string
	Password     string
	Host         string
	Port         string
	Name         string
	MaxIdleConns int
	MaxOpenConns int
	DisableTLS   bool
}

Jump to

Keyboard shortcuts

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