database

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 14 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorMissingWhereClause = errors.New("WHERE conditions required")
)

Functions

func GetDsn added in v1.0.0

func GetDsn(connection string) (string, error)

func NewGormInstance added in v1.0.0

func NewGormInstance(connection string) (*gorm.DB, error)

DEPRECATED: use gorm.New()

Types

type DB added in v1.0.0

type DB struct {
	// contains filtered or unexported fields
}

func (*DB) Connection added in v1.0.0

func (r *DB) Connection(name string) database.DB

func (*DB) Query added in v1.0.0

func (r *DB) Query() database.Sqlx

func (*DB) Transaction added in v1.0.0

func (r *DB) Transaction(ctx context.Context, txFunc func(tx *sqlx.Tx) error) error

type Orm added in v1.0.0

type Orm struct {
	// contains filtered or unexported fields
}

func NewOrm added in v1.0.0

func NewOrm(ctx context.Context) *Orm

func (*Orm) Connection added in v1.0.0

func (r *Orm) Connection(name string) ormcontract.Orm

func (*Orm) DB added in v1.8.0

func (r *Orm) DB() (*sql.DB, error)

func (*Orm) Query added in v1.0.0

func (r *Orm) Query() ormcontract.DB

func (*Orm) Transaction added in v1.0.0

func (r *Orm) Transaction(txFunc func(tx ormcontract.Transaction) error) error

func (*Orm) WithContext added in v1.0.0

func (r *Orm) WithContext(ctx context.Context) ormcontract.Orm

type ServiceProvider

type ServiceProvider struct {
}

func (*ServiceProvider) Boot

func (database *ServiceProvider) Boot()

func (*ServiceProvider) Register

func (database *ServiceProvider) Register()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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