Documentation
¶
Index ¶
- Variables
- func DeleteWhereTyped[T any](db *DB, table string, predicate func(T) bool) int
- func InsertManyTyped[T any](db *DB, table string, records []T)
- func MapTyped[T any, R any](db *DB, table string, mapper func(T) R) []R
- func SelectByIDTyped[T any](db *DB, table string, id string) (*T, bool)
- func SelectTyped[T any](db *DB, table string) []T
- func SelectWhereTyped[T any](db *DB, table string, predicate func(T) bool) []T
- func UpdateWhereTyped[T any](db *DB, table string, predicate func(T) bool, updater func(T) T) int
- func UpsertManyTyped[T any](db *DB, table string, records []T)
- func UpsertTyped[T any](db *DB, table string, id string, record T)
- func UpsertWhereTyped[T any](db *DB, table string, predicate func(T) bool, record T, updater func(T) T)
- type DB
- func (db *DB) Count(table string) int
- func (db *DB) Delete(table string, id string) bool
- func (db *DB) DeleteWhere(table string, predicate func(interface{}) bool) int
- func (db *DB) Exists(table string, id string) bool
- func (db *DB) Insert(table string, record interface{})
- func (db *DB) InsertMany(table string, records []interface{})
- func (db *DB) Map(table string, mapper func(interface{}) interface{}) []interface{}
- func (db *DB) Select(table string) []interface{}
- func (db *DB) SelectByID(table string, id string) (interface{}, bool)
- func (db *DB) SelectWhere(table string, predicate func(interface{}) bool) []interface{}
- func (db *DB) Transaction(fn func(*DB) error) error
- func (db *DB) Truncate(table string)
- func (db *DB) Update(table string, id string, record interface{}) bool
- func (db *DB) UpdateWhere(table string, predicate func(interface{}) bool, ...) int
- func (db *DB) Upsert(table string, id string, record interface{})
- func (db *DB) UpsertMany(table string, records []interface{})
- func (db *DB) UpsertWhere(table string, predicate func(interface{}) bool, record interface{}, ...)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DeleteWhereTyped ¶ added in v0.0.8
func InsertManyTyped ¶ added in v0.0.8
func SelectByIDTyped ¶ added in v0.0.8
func SelectTyped ¶ added in v0.0.8
func SelectWhereTyped ¶ added in v0.0.8
func UpdateWhereTyped ¶ added in v0.0.8
func UpsertManyTyped ¶ added in v0.0.9
func UpsertTyped ¶ added in v0.0.9
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) DeleteWhere ¶ added in v0.0.8
func (*DB) InsertMany ¶ added in v0.0.8
func (*DB) SelectByID ¶ added in v0.0.8
func (*DB) SelectWhere ¶ added in v0.0.8
func (*DB) UpdateWhere ¶ added in v0.0.8
func (*DB) UpsertMany ¶ added in v0.0.9
func (*DB) UpsertWhere ¶ added in v0.0.9
Click to show internal directories.
Click to hide internal directories.