Documentation
¶
Index ¶
- func RegisterCustomType(t reflect.Type, fn CustomTypeFunc)
- type CustomTypeFunc
- type MyDB
- func (db *MyDB) Begin() (*sql.Tx, error)
- func (db *MyDB) BulkInsert(table string, data []map[string]interface{}) (sql.Result, error)
- func (db *MyDB) BulkUpdate(table string, data []map[string]interface{}, key string) error
- func (db *MyDB) Get(dest interface{}, query string, args ...interface{}) error
- func (db *MyDB) In(query string, args ...interface{}) (string, []interface{}, error)
- func (db *MyDB) NamedExec(query string, arg map[string]interface{}) (sql.Result, error)
- func (db *MyDB) Select(dest interface{}, query string, args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCustomType ¶
func RegisterCustomType(t reflect.Type, fn CustomTypeFunc)
RegisterCustomType registers a custom type and its conversion function.
Types ¶
type CustomTypeFunc ¶
CustomTypeFunc is a type for functions that convert a string to a custom type.
type MyDB ¶
myDB wraps a sql.DB connection pool.
func (*MyDB) BulkInsert ¶
BulkInsert inserts multiple rows into the specified table.
func (*MyDB) BulkUpdate ¶
BulkUpdate updates multiple rows in the specified table based on the key column.
Click to show internal directories.
Click to hide internal directories.