db

package
v0.0.0-...-f4d84f6 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxMySQLPlaceholders = 65535
)

Variables

This section is empty.

Functions

func SliceQuery

func SliceQuery(
	placeholders []string, args []interface{}, numberOfColumns int,
) (
	plChunks [][]string, argsChunks [][]interface{}, err error,
)

SliceQuery slices placeholders (db args "(?,?,?)"), and arguments into chunks of maximum fittable size of MaxMySQLPlaceholders size placeholders - array of (?,?,?,?) args - array of arguments (values) Returns two 2d arrays of equal size, plChunks will contain placeholders, and argsChunks will contain arguments The ordering of plChunks matches that of argsChunks and vice versa.

func WithRetrier

func WithRetrier(d *sqlx.DB) *wrapper

WithRetrier wraps d and overwrites its methods with retrier

Types

type Storer

type Storer interface {
	Type() string
	InnerDB() *sqlx.DB
	Close() error
}

func SetupRDBMS

func SetupRDBMS(dsn string, mtrcs metrics.Metrics) (_ Storer, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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