Documentation
¶
Index ¶
- Constants
- Variables
- func GetLastMigrationAvailable(from uint) (uint, error)
- func IsSerializationError(err error) bool
- func IsUniqueViolation(err error) bool
- func MigrateDown(connectionString string) error
- func MigrateTo(connectionString string, version uint) error
- func MigrateUp(connectionString string) error
- func MigrateVersion(connectionString string) (uint, bool, error)
- func Prefix(prefix string) string
- type Database
- type DatabaseMigrator
- type Migrator
- type Rows
- type SqlxDatabase
- type Tx
- type TxFunc
- type TxOpt
- type TxOptions
Constants ¶
View Source
const ( SerializationRetryMaxAttempts = 10 SerializationRetryStartInterval = time.Millisecond * 2 )
Variables ¶
Functions ¶
func IsSerializationError ¶
func IsUniqueViolation ¶
func MigrateDown ¶
Types ¶
type Database ¶
type DatabaseMigrator ¶
type DatabaseMigrator struct {
// contains filtered or unexported fields
}
func NewDatabaseMigrator ¶
func NewDatabaseMigrator(connectionString string) *DatabaseMigrator
type SqlxDatabase ¶
type SqlxDatabase struct {
// contains filtered or unexported fields
}
func NewSqlxDatabase ¶
func NewSqlxDatabase(db *sqlx.DB) *SqlxDatabase
func (*SqlxDatabase) Close ¶
func (d *SqlxDatabase) Close() error
func (*SqlxDatabase) Queryx ¶
func (d *SqlxDatabase) Queryx(query string, args ...interface{}) (*Rows, error)
func (*SqlxDatabase) Stats ¶
func (d *SqlxDatabase) Stats() sql.DBStats
type TxOpt ¶
type TxOpt func(*TxOptions)
func WithContext ¶
func WithIsolationLevel ¶
func WithIsolationLevel(level sql.IsolationLevel) TxOpt
func WithLogger ¶
type TxOptions ¶
type TxOptions struct {
// contains filtered or unexported fields
}
func DefaultTxOptions ¶
func DefaultTxOptions() *TxOptions
Click to show internal directories.
Click to hide internal directories.