Documentation ¶
Index ¶
- func Connect()
- func ConnectConfig(conf config.DBConf)
- func NewNullTime(t time.Time) sql.NullTime
- func ParseError(err error) (bool, error)
- func RunWithinTransaction(rlog log.Ext1FieldLogger, tx *sqlx.Tx, fn func(*sqlx.Tx) error) error
- func Transact(rlog log.Ext1FieldLogger, fn func(*sqlx.Tx) error) error
- type BitBool
- type NullString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectConfig ¶ added in v0.3.0
ConnectConfig connects to the database using the passed config
func NewNullTime ¶ added in v0.4.0
NewNullTime creates a new sql.NullTime from the given time.Time
func ParseError ¶ added in v0.4.0
ParseError parses the passed error for a sql.ErrNoRows
func RunWithinTransaction ¶
RunWithinTransaction runs the passed function using the passed transaction; if nil is passed as tx a new transaction is created. This is basically a wrapper function, that works with a possible nil-tx
Types ¶
type BitBool ¶
type BitBool bool
BitBool is an implementation of a bool for the MySQL type BIT(1). This type allows you to avoid wasting an entire byte for MySQL's boolean type TINYINT.
type NullString ¶ added in v0.2.0
type NullString struct {
sql.NullString
}
NullString extends the sql.NullString
func NewNullString ¶
func NewNullString(s string) NullString
NewNullString creates a new NullString from the given string
func (NullString) MarshalJSON ¶ added in v0.2.0
func (s NullString) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (*NullString) UnmarshalJSON ¶ added in v0.2.0
func (s *NullString) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface