database

package
v1.0.0-...-a0f063d Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func NewDatabase

func NewDatabase(ctx context.Context, connectionName string) (*Database, error)

func WrapDB

func WrapDB(ctx context.Context, db ormcontract.DB) *Database

func (*Database) Connection

func (d *Database) Connection(connectionName string) ormcontract.IOrm

func (*Database) DB

func (d *Database) DB() (*sql.DB, error)

func (*Database) Gorm

func (d *Database) Gorm() *gorm.DB

func (*Database) Query

func (d *Database) Query() ormcontract.DB

func (*Database) Transaction

func (d *Database) Transaction(txFunc func(tx ormcontract.Transaction) error) error

func (*Database) WithContext

func (d *Database) WithContext(ctx context.Context) ormcontract.IOrm

type DatabaseManager

type DatabaseManager struct {
	manager.Manager[ormcontract.IOrm]
}

func NewDatabaseManager

func NewDatabaseManager() *DatabaseManager

func (*DatabaseManager) Connection

func (m *DatabaseManager) Connection(name string) ormcontract.IOrm

func (*DatabaseManager) DefaultDatabaseName

func (m *DatabaseManager) DefaultDatabaseName() string

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