gormdb

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 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 Config

type Config struct {
	Type, Charset, Database, TimeZone string
	Host                              string
	Port                              int32
	User, Password                    string
	Postgres                          PostgresConfig
	Mysql                             MysqlConfig
	Sqlite                            SqliteConfig
	MaxIdleConns, MaxOpenConns        int
	ConnMaxLifetime, ConnMaxIdleTime  time.Duration

	Gorm gorm.Config

	UseGormLogger bool
	Logger        logger.Config

	NamingStrategy schema.NamingStrategy

	Prometheus PrometheusConfig
}

func (*Config) AfterInject

func (c *Config) AfterInject()

func (*Config) BeforeInjectWithRoot

func (c *Config) BeforeInjectWithRoot(conf *rootconf.RootConfig)

func (*Config) Build

func (c *Config) Build(dialector gorm.Dialector) (*gorm.DB, error)

func (*Config) Init added in v0.9.9

func (c *Config) Init()

type DB

type DB struct {
	*gorm.DB
	Conf Config
}

func (*DB) Table

func (db *DB) Table(name string) *gorm.DB

type MetricsCollectorConfig added in v0.9.9

type MetricsCollectorConfig struct {
	Prefix        string
	Interval      uint32
	VariableNames []string
}

type MysqlConfig added in v0.9.9

type MysqlConfig struct {
	ParseTime string
	Loc       string
}

type PostgresConfig added in v0.9.9

type PostgresConfig struct {
	Schema  string
	SSLMode string
}

type PrometheusConfig added in v0.9.9

type PrometheusConfig struct {
	Enabled bool
	prometheus.Config
	MetricsCollectors []MetricsCollectorConfig
}

type SqliteConfig added in v0.9.9

type SqliteConfig struct {
	DSN string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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