mysql

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSQLNotFound = errors.New("not found")

ErrSQLNotFound happens when no rows were found

Functions

func NewConnPool

func NewConnPool(mysqlDBConf Config) (*sqlx.DB, error)

NewConnPool connects to db and return a connection pool

Types

type Config

type Config struct {
	Protocol string
	Host     string
	Port     string
	User     string
	Password string
	DbName   string
}

Config is a conf for the mysql database

type QueryFilter

type QueryFilter struct {
	FilterSQL   string
	NamedParams map[string]interface{}
}

QueryFilter allows for select filters

type SQLNamedExecuter

type SQLNamedExecuter interface {
	NamedExecContext(ctx context.Context, query string, arg interface{}) (
		sql.Result, error,
	)
}

SQLNamedExecuter is an interface used for CUD

type SQLNamedQueryer

type SQLNamedQueryer interface {
	NamedQueryContext(ctx context.Context, query string, arg interface{}) (
		*sqlx.Rows, error,
	)
}

SQLNamedQueryer is used to do select queries

Jump to

Keyboard shortcuts

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