Versions in this module Expand all Collapse all v1 v1.0.1 Apr 23, 2021 Changes in this version + var Debug = true + var Default = MySQL + var MySQL = &Database + var PostgreSQL = &Database + var SQLite = &Database + func Columns(src interface{}, includePk bool) ([]string, error) + func ColumnsQuoted(src interface{}, includePk bool) (string, error) + func DriverErr(err error) (error, bool) + func Insert(db DB, table string, src interface{}) error + func Load(db DB, table string, dst interface{}, pk int64) error + func LowerCase(in string) string + func Placeholders(src interface{}, includePk bool) ([]string, error) + func PlaceholdersString(src interface{}, includePk bool) (string, error) + func PrimaryKey(src interface{}) (name string, pk int64, err error) + func QueryAll(db DB, dst interface{}, query string, args ...interface{}) error + func QueryRow(db DB, dst interface{}, query string, args ...interface{}) error + func Register(name string, m Meddler) + func Save(db DB, table string, src interface{}) error + func Scan(rows *sql.Rows, dst interface{}) error + func ScanAll(rows *sql.Rows, dst interface{}) error + func ScanRow(rows *sql.Rows, dst interface{}) error + func SetPrimaryKey(src interface{}, pk int64) error + func SnakeCase(in string) string + func SomeValues(src interface{}, columns []string) ([]interface{}, error) + func Targets(dst interface{}, columns []string) ([]interface{}, error) + func Update(db DB, table string, src interface{}) error + func Values(src interface{}, includePk bool) ([]interface{}, error) + func WriteTargets(dst interface{}, columns []string, targets []interface{}) error + type DB interface + Exec func(query string, args ...interface{}) (sql.Result, error) + Query func(query string, args ...interface{}) (*sql.Rows, error) + QueryRow func(query string, args ...interface{}) *sql.Row + type Database struct + Placeholder string + Quote string + UseReturningToGetID bool + func (d *Database) Columns(src interface{}, includePk bool) ([]string, error) + func (d *Database) ColumnsQuoted(src interface{}, includePk bool) (string, error) + func (d *Database) Insert(db DB, table string, src interface{}) error + func (d *Database) Load(db DB, table string, dst interface{}, pk int64) error + func (d *Database) Placeholders(src interface{}, includePk bool) ([]string, error) + func (d *Database) PlaceholdersString(src interface{}, includePk bool) (string, error) + func (d *Database) PrimaryKey(src interface{}) (name string, pk int64, err error) + func (d *Database) QueryAll(db DB, dst interface{}, query string, args ...interface{}) error + func (d *Database) QueryRow(db DB, dst interface{}, query string, args ...interface{}) error + func (d *Database) Save(db DB, table string, src interface{}) error + func (d *Database) Scan(rows *sql.Rows, dst interface{}) error + func (d *Database) ScanAll(rows *sql.Rows, dst interface{}) error + func (d *Database) ScanRow(rows *sql.Rows, dst interface{}) error + func (d *Database) SetPrimaryKey(src interface{}, pk int64) error + func (d *Database) SomeValues(src interface{}, columns []string) ([]interface{}, error) + func (d *Database) Targets(dst interface{}, columns []string) ([]interface{}, error) + func (d *Database) Update(db DB, table string, src interface{}) error + func (d *Database) Values(src interface{}, includePk bool) ([]interface{}, error) + func (d *Database) WriteTargets(dst interface{}, columns []string, targets []interface{}) error + type GobMeddler bool + func (zip GobMeddler) PostRead(fieldAddr, scanTarget interface{}) error + func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) + func (zip GobMeddler) PreWrite(field interface{}) (saveValue interface{}, err error) + type IdentityMeddler bool + func (elt IdentityMeddler) PostRead(fieldAddr, scanTarget interface{}) error + func (elt IdentityMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) + func (elt IdentityMeddler) PreWrite(field interface{}) (saveValue interface{}, err error) + type JSONMeddler bool + func (zip JSONMeddler) PostRead(fieldAddr, scanTarget interface{}) error + func (zip JSONMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) + func (zip JSONMeddler) PreWrite(field interface{}) (saveValue interface{}, err error) + type MapperFunc func(in string) string + var Mapper MapperFunc = strings.TrimSpace + type Meddler interface + PostRead func(fieldAddr interface{}, scanTarget interface{}) error + PreRead func(fieldAddr interface{}) (scanTarget interface{}, err error) + PreWrite func(field interface{}) (saveValue interface{}, err error) + type TimeMeddler struct + Local bool + ZeroIsNull bool + func (elt TimeMeddler) PostRead(fieldAddr, scanTarget interface{}) error + func (elt TimeMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) + func (elt TimeMeddler) PreWrite(field interface{}) (saveValue interface{}, err error) + type ZeroIsNullMeddler bool + func (elt ZeroIsNullMeddler) PostRead(fieldAddr, scanTarget interface{}) error + func (elt ZeroIsNullMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) + func (elt ZeroIsNullMeddler) PreWrite(field interface{}) (saveValue interface{}, err error)