pg

package
v0.0.0-...-94b8d0d Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, cfg *Config) (db.IDB, error)

Types

type Config

type Config struct {
	DB       *sqlx.DB // You can supply either an sql.DB object or config of the database connection, but not both (mutually exclusive)
	Host     *string
	Port     *uint
	Name     *string
	Username *string
	Password *string
	SslMode  *bool // SSLMode is the ssl mode of the database connection, default is disable

	ReplicaDB       *sqlx.DB // ReplicaDB is the database connection for replication, it's optional, if it's not provided, then it will use the same connection as the main database
	ReplicaHost     *string
	ReplicaPort     *uint
	ReplicaName     *string
	ReplicaUsername *string
	ReplicaPassword *string
	ReplicaSslMode  *bool
}

Jump to

Keyboard shortcuts

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