Documentation ¶
Index ¶
- func ErrCheck(err error, extraInfo string)
- func ErrCheckWithFields(err error, extraInfo string, fields log.Fields)
- func FatalCheck(err error, extraInfo string)
- func FatalCheckWithFields(err error, extraInfo string, fields log.Fields)
- func GetCurrentVersion(d *sqlx.DB) int
- func Migrate(d *sqlx.DB, migrationDir string, dryrun bool)
- func TruncateTable(d *sqlx.DB, tableName string)
- type OrderDirection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrCheckWithFields ¶
ErrCheckWithFields considers logs errors with fields
func FatalCheck ¶
FatalCheck is just shorthand for FatalCheckWithFields when you have no fields
func FatalCheckWithFields ¶
FatalCheckWithFields considers any non-nil err fatal, and kills the process with as much logging information as possible
func GetCurrentVersion ¶
GetCurrentVersion returns the current schema version as an integer, or nil with an error
func Migrate ¶
Migrate ensures the db supports migration, loads bootstrap info, and applies as many migrations as it can in order until there are no migrations left to run, or a migration produces an error.
func TruncateTable ¶
TruncateTable nukes a table and anything keyed off it
Types ¶
type OrderDirection ¶
type OrderDirection int
OrderDirection is for use with SQL ORDER clause
const ( // OrderAscending corresponds to SQL's ASCENDING directive OrderAscending OrderDirection = iota // OrderDescending corresponds to SQL's DESCENDING directive OrderDescending )
func (OrderDirection) String ¶
func (o OrderDirection) String() (out string)
String returns the SQL syntax for an OrderDirection