Documentation ¶
Overview ¶
Package postgres provide faktory method for postgres db.Option
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFromConfig ¶
NewFromConfig returns postgres-based *sqlx.DB instance from yaml config file
given config file contents: db: primary: username: <username> password: "<password>" host: mydb.ap-southeast-1.rds.amazonaws.com port: 5432 schema: my_db_schema conn: max-idle: 20 max-lifetime: 10m timeout: 5m max-open: 100 keep-alive-interval: 30s then we can call using : v := viper.New() ... set v file configs, etc db, err := log.NewFromConfig(v, "db.primary") ...continue using db.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.