database

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DBPath          string `toml:"db_path" json:"db_path"`
	DBName          string `toml:"dbname" json:"dbname"`
	MaxIdleConns    int    `toml:"max_idle_conns" json:"max_idle_conns"`
	MaxOpenConns    int    `toml:"max_open_conns" json:"max_open_conns"`
	ConnMaxIdletime int    `toml:"conn_max_idletime" json:"conn_max_idletime"`
	ConnMaxLifetime int    `toml:"conn_max_lifetime" json:"conn_max_lifetime"`
}

type SqliteComponent

type SqliteComponent struct {
	DBMap   map[string]*gorm.DB `toml:"-"`
	Configs []Config            `toml:"configs" json:"configs"`
}

func NewGormDatabase

func NewGormDatabase(conf config.ConfigMate) *SqliteComponent

func (*SqliteComponent) GetDatabase

func (sc *SqliteComponent) GetDatabase(dbName string, dst ...any) *gorm.DB

func (*SqliteComponent) Name

func (sc *SqliteComponent) Name() string

Jump to

Keyboard shortcuts

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