Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(tx *sqlx.Tx, constructor constructorFunc, query string, ids ...interface{}) (interface{}, error)
Get is an internal function for getting one element from SQL by ID and parsing the element as a struct. If the query returns an empty result set the function will return nil (and no error).
- tx is a transaction used to execute the SQL
- constructor is a function that returns a pointer to a prototype element (i.e. `new(MyStruct)`).
- query is the actual SQL statement (with parameter placeholders).
- ids is one or more ID used to identify the of the object to retrieve (one per placeholder in the the query)
func GetAll ¶
func GetAll(tx *sqlx.Tx, constructor constructorFunc, query string, params ...interface{}) ([]interface{}, error)
GetAll is an internal function for retrieving a set of rows and parsing each of them as a struct. - tx is a transaction used to execute the SQL - constructor is a function that returns a pointer to a prototype element (i.e. `new(MyStruct)`). - query is the actual SQL statement (with parameter placeholders). - params is the parameters user to replace the placeholders in the SQL statement
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.