utils

package
v0.0.0-...-1609ee8 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDB

func CreateDB(dc *mconn.DBConfig) (*sql.DB, error)

CreateDB create a database connection with default args

func CreateDBWithArgs

func CreateDBWithArgs(dc *mconn.DBConfig, ops ...CreateDBOpFn) (*sql.DB, error)

CreateDBWithArgs create a database connection with args

func GetTableKey

func GetTableKey(schema, table string) string

GetTableKey returns the key of table

Types

type CreateDBOp

type CreateDBOp struct {
	// contains filtered or unexported fields
}

CreateDBOp holds all optional fields

type CreateDBOpFn

type CreateDBOpFn func(*CreateDBOp)

CreateDBOpFn set the option's field

func WithCharset

func WithCharset(charset string) CreateDBOpFn

WithCharset set the charset to the connection

func WithInterpolateParams

func WithInterpolateParams(enable bool) CreateDBOpFn

WithInterpolateParams set text generate mode to the connection

func WithTimeout

func WithTimeout(timeout int) CreateDBOpFn

WithTimeout set the timeout to the connetion

Jump to

Keyboard shortcuts

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