Documentation ¶
Index ¶
- func ConvertAssign(dest, src interface{}) error
- func Fields(names []string) string
- func Float64(v *float64) float64
- func Float64p(v float64) *float64
- func GetMaps(rows *sql.Rows) ([]map[string]interface{}, error)
- func InsertMap(db *sql.DB, table string, m map[string]interface{}) (sql.Result, error)
- func Int64(v *int64) int64
- func Int64p(v int64) *int64
- func Nbool(v bool) sql.NullBool
- func Nfloat64(v float64) sql.NullFloat64
- func Nint64(v int64) sql.NullInt64
- func Nstring(v string) sql.NullString
- func QueryArger(db *sql.DB, query string, arger Arger, args ...interface{}) (found bool, err error)
- func QueryArgers(db *sql.DB, query string, strcts interface{}, typ reflect.Type, ...) error
- func QueryMap(db *sql.DB, query string, args ...interface{}) (map[string]interface{}, error)
- func QueryMaps(db *sql.DB, query string, args ...interface{}) ([]map[string]interface{}, error)
- func ScanMapIntoStruct(obj interface{}, objMap map[string][]byte) error
- func ScanStructIntoMap(obj interface{}) (map[string]interface{}, error)
- func String(v *string) string
- func Stringp(v string) *string
- type Arger
- type NullTime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAssign ¶
func ConvertAssign(dest, src interface{}) error
ConvertAssign copies to dest the value in src, converting it if possible. An error is returned if the copy would result in loss of information. dest should be a pointer type.
func Nfloat64 ¶
func Nfloat64(v float64) sql.NullFloat64
func Nstring ¶
func Nstring(v string) sql.NullString
func QueryArger ¶
Querys the database for one row, and sets the data in arger. Usage:
var account Accounts // implements Arger found, err := QueryArger(db, `select * from Accounts where username = ?`, &account, "kevin")
func QueryArgers ¶
func QueryArgers(db *sql.DB, query string, strcts interface{}, typ reflect.Type, args ...interface{}) error
Queries database for many rows, and sets the strcts interface as the returned rows. Usage:
var strcts []Accounts // Each Accounts implements Arger err := helper.QueryArgers(db, `select * from Accounts`, &strcts, reflect.TypeOf(Accounts{}))
func ScanMapIntoStruct ¶
func ScanStructIntoMap ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.