Documentation ¶
Index ¶
- type Conn
- func (this *Conn) BulkInsert(cmd string, nCol int, args ...interface{}) error
- func (this *Conn) BulkInsertEx(cmd string, nCol int, args []interface{}, szSQLsurfix ...string) error
- func (this *Conn) BulkInsert_obsolete(cmd string, records [][]interface{}) error
- func (this *Conn) Close() error
- func (this *Conn) Context() context.Context
- func (this *Conn) Exec(cmd string, args ...interface{}) error
- func (this *Conn) Ping() error
- func (this *Conn) Query(query string, args ...interface{}) (QArray, error)
- func (this *Conn) QueryCount(query string, args ...interface{}) (int64, error)
- func (this *Conn) Select(dest interface{}, query string, args ...interface{}) error
- func (this *Conn) WithContext(ctx context.Context) *Conn
- type DBServer
- type QArray
- func (array *QArray) Base64Encode(key ...string) *QArray
- func (array *QArray) IntToBool(key ...string) *QArray
- func (array *QArray) Shuffle() *QArray
- func (array *QArray) ToFloat64(key ...string) *QArray
- func (array *QArray) ToInt64(key ...string) *QArray
- func (array *QArray) ToRawArray() []interface{}
- type QItem
- func (item QItem) AsMap() map[string]interface{}
- func (item QItem) Base64Encode(keys ...string) QItem
- func (item QItem) GetColumnFloat64(key string) float64
- func (item QItem) GetColumnInt64(key string) int64
- func (item QItem) GetColumnString(key string) string
- func (item QItem) IntToBool(keys ...string) QItem
- func (item QItem) ToFloat64(keys ...string) QItem
- func (item QItem) ToInt64(keys ...string) QItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) BulkInsert ¶
insert many records at one shot. often insert many logs. values := make([]interface{}, 0, batchsize*nCol) conn.BulkInsert("insert into files(bucket,filename)", nCol, values...)
func (*Conn) BulkInsertEx ¶
func (this *Conn) BulkInsertEx(cmd string, nCol int, args []interface{}, szSQLsurfix ...string) error
conn.BulkInsertEx("insert into msgs(fid, username, area)", nColumn, values, "ON CONFLICT(fid) DO NOTHING") reference: INSERT INTO ON CONFLICT DO NOTHING reference: INSERT INTO ON CONFLICT DO UPDATE
func (*Conn) BulkInsert_obsolete ¶
insert many records at one shot. often insert many logs. DO NOT USE THIS, IT'IS SLOW
func (*Conn) QueryCount ¶
select count(*) from ...
type DBServer ¶
type DBServer struct {
// contains filtered or unexported fields
}
func (*DBServer) ExecInTxContext ¶
type QArray ¶
type QArray []QItem
func MakeQArray ¶
func MakeQArray() QArray
func (*QArray) Base64Encode ¶
func (*QArray) ToRawArray ¶
func (array *QArray) ToRawArray() []interface{}
type QItem ¶
type QItem map[string]interface{}
func (QItem) Base64Encode ¶
func (QItem) GetColumnFloat64 ¶
func (QItem) GetColumnInt64 ¶
func (QItem) GetColumnString ¶
Click to show internal directories.
Click to hide internal directories.