Documentation
¶
Index ¶
- Constants
- func BuildInsertStatementString(pDbType DbType, pTable string, pFields []string, pOptions InsertOptions) (string, error)
- type BulkManager
- type BulkManagerInMemory
- type BulkManagerMultiRows
- type BulkOptions
- type DbHelper
- func (vSelf *DbHelper) Close() error
- func (vSelf *DbHelper) CreateInsert(pTable string, pFields []string, pOptions InsertOptions) (*SqlInsert, error)
- func (vSelf *DbHelper) Exec(pQuery string, pParameters ...interface{}) (sql.Result, error)
- func (vSelf *DbHelper) GetDb() *sql.DB
- func (vSelf *DbHelper) GetDbType() DbType
- func (vSelf *DbHelper) LoadBean(pBean IndentifiableInDb) error
- func (vSelf *DbHelper) Query(pQuery string, pArgs ...interface{}) (*DbHelperRows, error)
- func (vSelf *DbHelper) SaveBean(pBean IndentifiableInDb) error
- func (vSelf *DbHelper) SetMaxOpenConns(pNum int)
- type DbHelperRows
- type DbType
- type IndentifiableInDb
- type InsertOptions
- type SqlInsert
- func (vSelf *SqlInsert) BeginBulk(pBulkOptions BulkOptions) (bool, error)
- func (vSelf *SqlInsert) Close() error
- func (vSelf *SqlInsert) Commit() error
- func (vSelf *SqlInsert) EndBulk() error
- func (vSelf *SqlInsert) Exec(pParameters ...interface{}) (sql.Result, error)
- func (vSelf *SqlInsert) Lock()
- func (vSelf *SqlInsert) Unlock()
- type SqlLiteTimestamp
Constants ¶
View Source
const ( TABLE_BEANS = "beans" FIELD_BEANS_ID = "id" FIELD_BEANS_SERIALIZED = "serialized" DDL_BEANS_SQLITE = "create table if not exists " + TABLE_BEANS + " (" + FIELD_BEANS_ID + " text PRIMARY KEY , " + FIELD_BEANS_SERIALIZED + " BLOB)" DDL_BEANS_MYSQL = "create table if not exists " + TABLE_BEANS + " (" + FIELD_BEANS_ID + " varchar(700) PRIMARY KEY , " + FIELD_BEANS_SERIALIZED + " BLOB)" )
View Source
const (
BulkInsert_DefaultBatchSize = 100
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BulkManager ¶
type BulkManager interface {
Begin() error
Enqueue(...interface{}) error
Commit() error
End() error
}
func BuildBulkManager ¶
func BuildBulkManager(pParent *SqlInsert, pBulkOptions BulkOptions) (BulkManager, error)
func NewBulkManagerInMemory ¶
func NewBulkManagerInMemory(pParent *SqlInsert, pBatchSize int) (BulkManager, error)
func NewBulkManagerMultiRows ¶
func NewBulkManagerMultiRows(pParent *SqlInsert, pBatchSize int) (BulkManager, error)
type BulkManagerInMemory ¶
type BulkManagerInMemory struct {
// contains filtered or unexported fields
}
func (*BulkManagerInMemory) Begin ¶
func (vSelf *BulkManagerInMemory) Begin() error
func (*BulkManagerInMemory) Commit ¶
func (vSelf *BulkManagerInMemory) Commit() error
func (*BulkManagerInMemory) End ¶
func (vSelf *BulkManagerInMemory) End() error
func (*BulkManagerInMemory) Enqueue ¶
func (vSelf *BulkManagerInMemory) Enqueue(pParameters ...interface{}) error
type BulkManagerMultiRows ¶
type BulkManagerMultiRows struct {
// contains filtered or unexported fields
}
func (*BulkManagerMultiRows) Begin ¶
func (vSelf *BulkManagerMultiRows) Begin() error
func (*BulkManagerMultiRows) Commit ¶
func (vSelf *BulkManagerMultiRows) Commit() error
func (*BulkManagerMultiRows) End ¶
func (vSelf *BulkManagerMultiRows) End() error
func (*BulkManagerMultiRows) Enqueue ¶
func (vSelf *BulkManagerMultiRows) Enqueue(pParameters ...interface{}) error
type BulkOptions ¶
type BulkOptions struct {
BatchSize int
BulkManager BulkManager
}
type DbHelper ¶
type DbHelper struct {
// contains filtered or unexported fields
}
func NewDbHelperFor ¶
func (*DbHelper) CreateInsert ¶
func (*DbHelper) LoadBean ¶
func (vSelf *DbHelper) LoadBean(pBean IndentifiableInDb) error
func (*DbHelper) Query ¶
func (vSelf *DbHelper) Query(pQuery string, pArgs ...interface{}) (*DbHelperRows, error)
func (*DbHelper) SaveBean ¶
func (vSelf *DbHelper) SaveBean(pBean IndentifiableInDb) error
func (*DbHelper) SetMaxOpenConns ¶
type DbHelperRows ¶
type DbHelperRows struct {
// contains filtered or unexported fields
}
func (*DbHelperRows) Close ¶
func (vSelf *DbHelperRows) Close() error
func (*DbHelperRows) Columns ¶
func (vSelf *DbHelperRows) Columns() ([]string, error)
func (*DbHelperRows) Err ¶
func (vSelf *DbHelperRows) Err() error
func (*DbHelperRows) Next ¶
func (vSelf *DbHelperRows) Next() bool
func (*DbHelperRows) Scan ¶
func (vSelf *DbHelperRows) Scan(pDest ...interface{}) error
type IndentifiableInDb ¶
type IndentifiableInDb interface {
GetIdInDb() string
}
type InsertOptions ¶
type SqlInsert ¶
type SqlInsert struct {
// contains filtered or unexported fields
}
func (*SqlInsert) BeginBulk ¶
func (vSelf *SqlInsert) BeginBulk(pBulkOptions BulkOptions) (bool, error)
type SqlLiteTimestamp ¶
type SqlLiteTimestamp []byte
func (SqlLiteTimestamp) IsNull ¶
func (vSelf SqlLiteTimestamp) IsNull() bool
Click to show internal directories.
Click to hide internal directories.