gormconnection

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoVer = "0-null"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DBVersion

type DBVersion struct {
	Date    time.Time
	Version string
}

type GormConnection

type GormConnection struct {
	DB *gorm.DB
}

func NewConnection

func NewConnection(c *gorm.DB) *GormConnection

func (*GormConnection) Exec

func (c *GormConnection) Exec(sql string, values ...interface{}) error

func (*GormConnection) LoadVersions

func (c *GormConnection) LoadVersions() ([]string, error)

func (*GormConnection) SetVersion

func (c *GormConnection) SetVersion(ver string) error

func (*GormConnection) Tx

func (c *GormConnection) Tx() (migo.Transaction, error)

type GormTransaction

type GormTransaction struct {
	DB *gorm.DB
}

func NewTransaction

func NewTransaction(db *gorm.DB) (*GormTransaction, error)

func (*GormTransaction) Commit

func (tx *GormTransaction) Commit() error

func (*GormTransaction) Exec

func (tx *GormTransaction) Exec(sql string, values ...interface{}) error

func (*GormTransaction) Rollback

func (tx *GormTransaction) Rollback() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL