Documentation
¶
Overview ¶
query is a tiny package for executing select-like queries and converting sql.Rows into slice of map[string]string The new map[string]string is allocated for each row. Keys are column names as seen in sql.
Index ¶
- func Fetch(strQuery string, db *sql.DB) ([]map[string]string, error)
- func FetchLimited(strQuery string, rowsLimit uint64, db *sql.DB) ([]map[string]string, error)
- func NewQueryWrap(db *sql.DB) *queryWrap
- func NewQueryWrapVoid(db *sql.DB) *queryWrapVoid
- func Scan(dbRows *sql.Rows) ([]map[string]string, error)
- func ScanLimited(dbRows *sql.Rows, rowsLimit uint64) ([]map[string]string, error)
- func Select(strQuery string, db *sql.DB) ([]map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fetch ¶
Fetch is used to execute sql and convert expected rows to slice of map[string]string with keys as a column names.
func FetchLimited ¶
FetchLimited is used to execute sql query and convert expected rows to array of map[string]string with keys as a column names; no more than rowsLimit elements OR unlimited if 0.
func NewQueryWrap ¶ added in v1.1.0
func NewQueryWrapVoid ¶ added in v1.1.0
func Scan ¶
Scan converts already executed query result into a slice of Row with keys as a column names.
func ScanLimited ¶
ScanLimited converts already executed query result into a slice of Row with keys as a column names; no more than rowsLimit elements OR unlimited if 0.
Types ¶
This section is empty.