database

package
v0.0.0-...-057734e Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func GetDsn

func GetDsn(connection string) (string, error)

func NewGormInstance

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

DEPRECATED: use gorm.New()

Types

type DB

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

func (*DB) Connection

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

func (*DB) Query

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

func (*DB) Transaction

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

type Orm

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

func NewOrm

func NewOrm(ctx context.Context) *Orm

func (*Orm) Connection

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

func (*Orm) DB

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

func (*Orm) Query

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

func (*Orm) Transaction

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

func (*Orm) WithContext

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