database

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MySQLDriver driver is represented under DB_DRIVER
	// for MySQL.
	MySQLDriver = "mysql"
	// PostgresDriver driver is represented under
	// DB_DRIVER for postgres.
	PostgresDriver = "postgres"
)

Variables

View Source
var (
	ErrQueryMessage = "Error executing sql query"
)

Functions

func FilterRows

func FilterRows(driver Driver, query *builder.Sqlbuilder, filters map[string][]params.Filter, table string) error

FilterRows

filterRows takes in the filters from the params set in http.Params If there is no filters set, an empty string will be returned. Returns errors.INVALID if the operator or column name was not found.

Types

type Driver

type Driver interface {
	DB() *sqlx.DB
	Schema() string
	Builder() *builder.Sqlbuilder
	Install() error
	Tables() ([]string, error)
	Dump(path, filename string) error
	Drop() error
}

Driver

func New

func New(env *environment.Env) (Driver, error)

TODO

establish what drier it is and do a switch

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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