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) 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
- type TableWatcher
- type TxCompatible
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(id) DO NOTHING reference: INSERT INTO ON CONFLICT(sn,orgid) DO UPDATE SET status=excluded.status reference: INSERT INTO ON CONFLICT(id) DO UPDATE SET (status,name)=(excluded.status,excluded.name)
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 ¶
type TableWatcher ¶
type TableWatcher struct {
// contains filtered or unexported fields
}
func NewTableWatcher ¶
func NewTableWatcher(dataSourceName string) (*TableWatcher, error)
func (*TableWatcher) Close ¶
func (this *TableWatcher) Close() error
type TxCompatible ¶
Click to show internal directories.
Click to hide internal directories.