datasources

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(db *gorm.DB)

Types

type Config

type Config struct {
	User   string
	Pass   string
	Host   string
	Port   int
	Schema string

	ConnectionString string
	PoolConfig
	Debug bool
	gorm.Config
	// contains filtered or unexported fields
}

func (*Config) Build

func (c *Config) Build() gorm.Dialector

func (*Config) Dialect

func (c *Config) Dialect(builder dialects.Builder) *Config

func (*Config) String

func (c *Config) String() string

type DataSource

type DataSource struct {
	// contains filtered or unexported fields
}

func NewDataSource

func NewDataSource(c *Config) *DataSource

func (*DataSource) GetConnection

func (ds *DataSource) GetConnection() *gorm.DB

type Env

type Env struct {
	User             string
	Pass             string
	Host             string
	Port             string
	Schema           string
	ConnectionString string
	MaxIdleConns     string
	MaxOpenConns     string
	ConnMaxLifetime  string
	Debug            string
}

func (*Env) Build

func (e *Env) Build(builder dialects.Builder) *Config

type PoolConfig

type PoolConfig struct {
	MaxIdleConns    int
	MaxOpenConns    int
	ConnMaxLifetime time.Duration
}

Jump to

Keyboard shortcuts

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