Documentation
¶
Index ¶
- func Exec(tbl sqlgen2.Table, req require.Requirement, query string, args ...interface{}) (int64, error)
- func LogError(logger *log.Logger, err error) error
- func LogIfError(logger *log.Logger, err error) error
- func LogQuery(logger *log.Logger, query string, args ...interface{})
- func QueryOneNullThing(tbl sqlgen2.Table, req require.Requirement, holder interface{}, query string, ...) error
- func ReplaceTableName(tbl sqlgen2.Table, query string) string
- func UpdateFields(tbl sqlgen2.Table, req require.Requirement, wh where.Expression, ...) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exec ¶
func Exec(tbl sqlgen2.Table, req require.Requirement, query string, args ...interface{}) (int64, error)
Exec executes a modification query (insert, update, delete, etc) and returns the number of items affected.
func LogIfError ¶
LogIfError writes error info to the logger, if the logger and the error are not nil.
func QueryOneNullThing ¶
func QueryOneNullThing(tbl sqlgen2.Table, req require.Requirement, holder interface{}, query string, args ...interface{}) error
QueryOneNullThing queries for one cell of one record. Normally, the holder will be sql.NullString or similar.
func ReplaceTableName ¶
ReplaceTableName replaces all occurrences of "{TABLE}" with the table's name.
func UpdateFields ¶
func UpdateFields(tbl sqlgen2.Table, req require.Requirement, wh where.Expression, fields ...sql.NamedArg) (int64, error)
UpdateFields writes certain fields of all the records matching a 'where' expression.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.