Documentation ¶
Index ¶
- Variables
- func Connection() *sql.DB
- func Migrate(ctx context.Context, path string) error
- func Ping() error
- func Seed()
- type FieldInfo
- type NullInt
- type NullString
- type NullTime
- type RowMapper
- type Trx
- func (trx *Trx) Commit() error
- func (trx *Trx) Count(command string, args ...interface{}) (int, error)
- func (trx *Trx) Execute(command string, args ...interface{}) (int64, error)
- func (trx *Trx) Exists(command string, args ...interface{}) (bool, error)
- func (trx *Trx) Get(data interface{}, command string, args ...interface{}) error
- func (trx *Trx) MustCommit()
- func (trx *Trx) MustRollback()
- func (trx *Trx) Query(command string, args ...interface{}) (*sql.Rows, error)
- func (trx *Trx) Rollback() error
- func (trx *Trx) Scalar(data interface{}, command string, args ...interface{}) error
- func (trx *Trx) Select(data interface{}, command string, args ...interface{}) error
- type TypeMapper
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoChanges = stdErrors.New("nothing to migrate.")
ErrNoChanges means that the migration process didn't change execute any file
Functions ¶
func Connection ¶ added in v0.18.1
Types ¶
type NullInt ¶
NullInt representa a nullable integer
func (NullInt) MarshalJSON ¶
MarshalJSON interface redefinition
type NullString ¶
type NullString struct {
sql.NullString
}
NullString representa a nullable string
func (NullString) MarshalJSON ¶
func (r NullString) MarshalJSON() ([]byte, error)
MarshalJSON interface redefinition
type NullTime ¶
NullTime representa a nullable time.Time
func (NullTime) MarshalJSON ¶
MarshalJSON interface redefinition
type RowMapper ¶ added in v0.9.0
RowMapper is responsible for mapping a sql.Rows into a Struct (model)
func NewRowMapper ¶ added in v0.9.0
func NewRowMapper() *RowMapper
NewRowMapper creates a new instance of RowMapper
type Trx ¶
type Trx struct {
// contains filtered or unexported fields
}
Trx represents a Database transaction
func (*Trx) MustCommit ¶ added in v0.18.1
func (trx *Trx) MustCommit()
MustCommit current transaction
func (*Trx) MustRollback ¶ added in v0.18.1
func (trx *Trx) MustRollback()
MustRollback current transaction
type TypeMapper ¶ added in v0.9.0
TypeMapper holds information about how to map SQL ResultSet to a Struct
func NewTypeMapper ¶ added in v0.9.0
func NewTypeMapper(t reflect.Type) TypeMapper
NewTypeMapper creates a new instance of TypeMapper for given reflect.Type
Click to show internal directories.
Click to hide internal directories.