database

package
v0.0.0-...-3e1e274 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2016 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDriver

func AddDriver(driver string, cm ConfigMaker)

func SupportDrivers

func SupportDrivers() []string

Types

type Applyer

type Applyer interface {
	Apply(data map[string]interface{}, key string, value interface{}) bool
}

type Config

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

func NewPool

func NewPool(driver string) *Config

func (*Config) ConnectionString

func (c *Config) ConnectionString() string

func (*Config) Json

func (c *Config) Json(data string) *Config

func (*Config) Open

func (c *Config) Open(poolsize int) *DBPool

func (*Config) OpenDirect

func (c *Config) OpenDirect() *Database

func (*Config) Set

func (c *Config) Set(key string, value interface{}) *Config

type ConfigMaker

type ConfigMaker interface {
	Init(data map[string]interface{})
	TemplateString() string
	Applyer
}

type ConfigMakerBase

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

func (*ConfigMakerBase) AddKey

func (cm *ConfigMakerBase) AddKey(kind reflect.Kind, key string, morekeys ...string)

func (*ConfigMakerBase) Apply

func (cm *ConfigMakerBase) Apply(data map[string]interface{}, key string, value interface{}) bool

func (*ConfigMakerBase) Init

func (cm *ConfigMakerBase) Init(data map[string]interface{})

func (*ConfigMakerBase) SetDefault

func (cm *ConfigMakerBase) SetDefault(key string, value interface{})

func (*ConfigMakerBase) TemplateString

func (cm *ConfigMakerBase) TemplateString() string

type DBPool

type DBPool struct {
	PostConnect []string
	IsForceUTF8 bool
	// contains filtered or unexported fields
}

func CreateDBPool

func CreateDBPool(driver string, ip string, port int, name string, id string, pw string, poolSize int) *DBPool

func CreateDBPoolByConnString

func CreateDBPoolByConnString(driver string, connString string, poolSize int) *DBPool

func (*DBPool) AddPostConnect

func (p *DBPool) AddPostConnect(v string)

func (*DBPool) GetDB

func (p *DBPool) GetDB() *Database

func (*DBPool) ReleaseDB

func (p *DBPool) ReleaseDB(db *Database)

type Database

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

func (*Database) Close

func (db *Database) Close() error

func (*Database) MutipleQuery

func (db *Database) MutipleQuery(queryList []string) error

func (*Database) Open

func (db *Database) Open(driver string, connString string) error

func (*Database) Query

func (db *Database) Query(queryStr string) (*Rows, error)

func (*Database) TempQuery

func (db *Database) TempQuery(queryStr string) (*Rows, error)

type Rows

type Rows struct {
	Cols []string
	// contains filtered or unexported fields
}

func (*Rows) Close

func (rows *Rows) Close() error

func (*Rows) FetchArray

func (rows *Rows) FetchArray() []interface{}

func (*Rows) FetchHash

func (rows *Rows) FetchHash() map[string]interface{}

func (*Rows) IsNil

func (rows *Rows) IsNil() bool

func (*Rows) Next

func (rows *Rows) Next() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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