gorm_plugin

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GormDecorate added in v1.3.3

func GormDecorate(database string) (*gorm.DB, error)

Types

type Configure added in v1.2.6

type Configure struct {
	bean.Component
	Level                  string `yaml:"loglevel"`
	SkipDefaultTransaction bool   `yaml:"skip_default_transaction"`
	NamingStrategy         struct {
		TablePrefix   string `yaml:"table_prefix"`
		SingularTable bool   `yaml:"singular_table"`
	} `yaml:"naming_strategy"`
	FullSaveAssociations                     bool `yaml:"full_save_associations"`
	DryRun                                   bool `yaml:"dry_run"`
	PrepareStmt                              bool `yaml:"prepare_stmt"`
	DisableAutomaticPing                     bool `yaml:"disable_automatic_ping"`
	DisableForeignKeyConstraintWhenMigrating bool `yaml:"disable_foreign_key_constraint_when_migrating"`
	DisableNestedTransaction                 bool `yaml:"disable_nested_transaction"`
	AllowGlobalUpdate                        bool `yaml:"allow_global_update"`
	QueryFields                              bool `yaml:"query_fields"`
	CreateBatchSize                          int  `yaml:"create_batch_size"`
}

func (*Configure) Prefix added in v1.2.6

func (g *Configure) Prefix() string

type GormLoggerAdapter added in v1.1.8

type GormLoggerAdapter struct {
	LogLevel
	SlowThreshold time.Duration
	// contains filtered or unexported fields
}

func NewGormLoggerAdapter added in v1.1.8

func NewGormLoggerAdapter(logger *GormLoggerAdapter) *GormLoggerAdapter

func (*GormLoggerAdapter) Error added in v1.1.8

func (g *GormLoggerAdapter) Error(ctx context.Context, s string, i ...interface{})

func (*GormLoggerAdapter) Info added in v1.1.8

func (g *GormLoggerAdapter) Info(ctx context.Context, s string, i ...interface{})

func (*GormLoggerAdapter) LogMode added in v1.1.8

func (g *GormLoggerAdapter) LogMode(level LogLevel) Interface

func (*GormLoggerAdapter) Trace added in v1.1.8

func (g *GormLoggerAdapter) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*GormLoggerAdapter) Warn added in v1.1.8

func (g *GormLoggerAdapter) Warn(ctx context.Context, s string, i ...interface{})

type GormProcessor

type GormProcessor struct {
	GormConfig Configure      `value:"gorm"`
	Log        logging.Logger `bean:"log"`
}

func (*GormProcessor) Do

func (r *GormProcessor) Do(bean bean.Bean)

func (*GormProcessor) Filter

func (r *GormProcessor) Filter(bean bean.Bean) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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