Documentation
¶
Index ¶
- Variables
- func DB(i Instance, db ...*gorm.DB) (value *gorm.DB, err error)
- func NewPlugin() (v *xPlugin)
- func NewSession(db *gorm.DB) *gorm.DB
- type ConnectCallback
- type DBSeeder
- type DRIVER
- type ENGINE
- type Instance
- type Json
- type Null
- type Options
- type Pagination
- type SeederEntry
- type SeederHandler
- type Set
Constants ¶
This section is empty.
Variables ¶
View Source
var Migration dbMigration
View Source
var Seeder dbSeeder
Functions ¶
Types ¶
type DBSeeder ¶ added in v1.9.12
type DBSeeder interface {
Seed(db *gorm.DB, entries []SeederEntry) (err error)
}
type Instance ¶
type Instance interface {
New() *gorm.DB
DB(db ...*gorm.DB) (value *gorm.DB, err error)
AddMigrations(models ...any)
AddSeeders(handlers ...SeederHandler)
Migrate(seed ...bool) (err error)
Seed(entries ...SeederEntry) (err error)
}
func ConnectWithCallback ¶ added in v1.9.9
func ConnectWithCallback(opts *Options, callback ConnectCallback) (i Instance, err error)
type Json ¶
type Json[T any] struct { Data T }
func (Json[T]) MarshalJSON ¶
func (*Json[T]) UnmarshalJSON ¶
type Null ¶
type Null[T comparable] struct { Data T Valid bool }
func (Null[T]) MarshalJSON ¶
func (*Null[T]) UnmarshalJSON ¶
type Options ¶
type Options struct {
Driver DRIVER
Host string
Port string
Username string
Password string
DBName string
Charset string
Collation string
DSN string
Engine ENGINE
Config *gorm.Config
MaxOpenConns int
MaxIdleConns int
ConnMaxLifetime int // Maximum lifetime for a connection (in milliseconds)
ConnMaxIdleTime int // Maximum idle time for a connection (in milliseconds)
}
type Pagination ¶
type SeederEntry ¶ added in v1.9.10
type SeederHandler ¶
type Set ¶ added in v1.8.1
type Set[T gokit.SetConstraint] struct { Data []T }
func (Set[T]) MarshalJSON ¶ added in v1.8.1
func (*Set[T]) UnmarshalJSON ¶ added in v1.8.1
Source Files
¶
Click to show internal directories.
Click to hide internal directories.