Documentation
¶
Index ¶
- func GetConfig(container goframe.IContainer) *contract.DbConfig
- func NewOrmService(params ...any) (any, error)
- func WithConfigPath(path string) contract.DbOption
- func WithDryRun() contract.DbOption
- func WithFullSaveAssociations() contract.DbOption
- func WithGormConfig(fn func(options *contract.DbConfig)) contract.DbOption
- type OrmLogger
- func (l *OrmLogger) Error(ctx context.Context, msg string, val ...any)
- func (l *OrmLogger) Info(ctx context.Context, msg string, val ...any)
- func (l *OrmLogger) LogMode(level logger.LogLevel) logger.Interface
- func (l *OrmLogger) Trace(ctx context.Context, begin time.Time, fn func() (string, int64), err error)
- func (l *OrmLogger) Warn(ctx context.Context, msg string, val ...any)
- type OrmProvider
- type OrmService
- func (s *OrmService) Get(option ...contract.DbOption) (*gorm.DB, error)
- func (s *OrmService) GetTableColumns(ctx context.Context, db *gorm.DB, table string) ([]contract.TableColumn, error)
- func (s *OrmService) GetTables(ctx context.Context, db *gorm.DB) ([]string, error)
- func (s *OrmService) HasTable(ctx context.Context, db *gorm.DB, table string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOrmService ¶
func WithConfigPath ¶
func WithDryRun ¶
Types ¶
type OrmLogger ¶
type OrmLogger struct {
// contains filtered or unexported fields
}
func NewOrmLogger ¶
type OrmProvider ¶
type OrmProvider struct{}
func (*OrmProvider) Boot ¶
func (p *OrmProvider) Boot(container goframe.IContainer) error
func (*OrmProvider) Inject ¶
func (p *OrmProvider) Inject(container goframe.IContainer) goframe.Handler
func (*OrmProvider) IsDefer ¶
func (p *OrmProvider) IsDefer() bool
func (*OrmProvider) Name ¶
func (p *OrmProvider) Name() string
func (*OrmProvider) Params ¶
func (p *OrmProvider) Params(container goframe.IContainer) []any
type OrmService ¶
type OrmService struct {
// contains filtered or unexported fields
}
func (*OrmService) GetTableColumns ¶
func (s *OrmService) GetTableColumns(ctx context.Context, db *gorm.DB, table string) ([]contract.TableColumn, error)
Click to show internal directories.
Click to hide internal directories.