Help us shape the future of Go! Take the 2026 Go Developer Survey

databasesfx

package
v3.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresMigrations added in v3.0.1

func NewPostgresMigrations(fs fs.FS, cfg PostgresConfig, migrations, migrationsTable string) (*migrate.Migrate, error)

func PostgresMigrationsModule

func PostgresMigrationsModule(mig fs.FS, cfg PostgresConfig, migrations string) fx.Option

func PostgresModule

func PostgresModule(cfg PostgresConfig) fx.Option

Types

type PostgresConfig

type PostgresConfig struct {
	ApplicationName       string        `required:"true" mapstructure:"application_name"         yaml:"application_name"         json:"application_name"`
	Timezone              string        `` /* 133-byte string literal not displayed */
	DBName                string        `required:"true" mapstructure:"dbname"                   yaml:"dbname"                   json:"dbname"`
	Schema                string        `` /* 136-byte string literal not displayed */
	Host                  string        `` /* 139-byte string literal not displayed */
	SslMode               string        `` /* 137-byte string literal not displayed */
	Password              string        `required:"true" mapstructure:"password"                 yaml:"password"                 json:"password"`
	Username              string        `required:"true" mapstructure:"username"                 yaml:"username"                 json:"username"`
	MaxIdleConnection     int           `required:"true" mapstructure:"max_idle_connections"     yaml:"max_idle_connections"     json:"max_idle_connections"`
	ConnectionTimeout     time.Duration `` /* 132-byte string literal not displayed */
	MaxOpenConnections    int           `required:"true" mapstructure:"max_open_connections"     yaml:"max_open_connections"     json:"max_open_connections"`
	MaxConnectionLifetime time.Duration `required:"true" mapstructure:"max_connection_lifetime"  yaml:"max_connection_lifetime"  json:"max_connection_lifetime"`
	MaxConnectionIdleTime time.Duration `required:"true" mapstructure:"max_connection_idle_time" yaml:"max_connection_idle_time" json:"max_connection_idle_time"`
	Port                  uint16        `` /* 134-byte string literal not displayed */
}

func (*PostgresConfig) ConnectionString

func (p *PostgresConfig) ConnectionString() string

Jump to

Keyboard shortcuts

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