# Functions
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()
..
NewPostgresDatabase - create & validate postgres connection given certain db.Option the caller have the responsibility to close the *sqlx.DB when succeed.