database

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 19 Imported by: 4

Documentation

Index

Constants

View Source
const BindingOrm = "goravel.orm"
View Source
const BindingSeeder = "goravel.seeder"

Variables

This section is empty.

Functions

This section is empty.

Types

type FactoryImpl added in v1.13.0

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

func NewFactoryImpl added in v1.13.0

func NewFactoryImpl(query ormcontract.Query) *FactoryImpl

func (*FactoryImpl) Count added in v1.13.0

func (f *FactoryImpl) Count(count int) ormcontract.Factory

Count Specify the number of models you wish to create / make.

func (*FactoryImpl) Create added in v1.13.0

func (f *FactoryImpl) Create(value any, attributes ...map[string]any) error

Create a model and persist it in the database.

func (*FactoryImpl) CreateQuietly added in v1.13.0

func (f *FactoryImpl) CreateQuietly(value any, attributes ...map[string]any) error

CreateQuietly create a model and persist it in the database without firing any events.

func (*FactoryImpl) Make added in v1.13.0

func (f *FactoryImpl) Make(value any, attributes ...map[string]any) error

Make a model instance that's not persisted in the database.

type InitializeImpl added in v1.14.0

type InitializeImpl struct{}

func NewInitializeImpl added in v1.14.0

func NewInitializeImpl() *InitializeImpl

func (*InitializeImpl) InitializeGorm added in v1.14.0

func (receive *InitializeImpl) InitializeGorm(config config.Config, connection string) contractsgorm.Gorm

func (*InitializeImpl) InitializeQuery added in v1.14.0

func (receive *InitializeImpl) InitializeQuery(ctx context.Context, config config.Config, connection string) (orm.Query, error)

type OrmImpl added in v1.12.0

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

func InitializeOrm added in v1.12.0

func InitializeOrm(ctx context.Context, config2 config.Config, connection string) (*OrmImpl, error)

func NewOrmImpl added in v1.12.0

func NewOrmImpl(ctx context.Context, config config.Config, connection string, query ormcontract.Query) (*OrmImpl, error)

func (*OrmImpl) Connection added in v1.12.0

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

func (*OrmImpl) DB added in v1.12.0

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

func (*OrmImpl) Factory added in v1.13.0

func (r *OrmImpl) Factory() ormcontract.Factory

func (*OrmImpl) Observe added in v1.12.0

func (r *OrmImpl) Observe(model any, observer ormcontract.Observer)

func (*OrmImpl) Query added in v1.12.0

func (r *OrmImpl) Query() ormcontract.Query

func (*OrmImpl) Transaction added in v1.12.0

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

func (*OrmImpl) WithContext added in v1.12.0

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

type SeederFacade added in v1.12.6

type SeederFacade struct {
	Seeders []seeder.Seeder
	Called  []string
}

func NewSeederFacade added in v1.12.6

func NewSeederFacade() *SeederFacade

func (*SeederFacade) Call added in v1.12.6

func (s *SeederFacade) Call(seeders []seeder.Seeder) error

Call executes the specified seeder(s).

func (*SeederFacade) CallOnce added in v1.12.6

func (s *SeederFacade) CallOnce(seeders []seeder.Seeder) error

CallOnce executes the specified seeder(s) only if they haven't been executed before.

func (*SeederFacade) GetSeeder added in v1.12.6

func (s *SeederFacade) GetSeeder(name string) seeder.Seeder

func (*SeederFacade) GetSeeders added in v1.12.6

func (s *SeederFacade) GetSeeders() []seeder.Seeder

func (*SeederFacade) Register added in v1.12.6

func (s *SeederFacade) Register(seeders []seeder.Seeder)

type ServiceProvider

type ServiceProvider struct {
}

func (*ServiceProvider) Boot

func (database *ServiceProvider) Boot(app foundation.Application)

func (*ServiceProvider) Register

func (database *ServiceProvider) Register(app foundation.Application)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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