Discover Packages
github.com/ram02z/neutral_diet
internal
app
sql
package
Version:
v0.0.0-...-64e57e2
Opens a new window with list of versions in this module.
Published: Aug 17, 2023
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package sql provides functions for working with PostgreSQL databases.
NewDatabase creates a new connection pool to a PostgreSQL database using the using the
configuration specified in the environment variables.
type Config struct {
DBConfig *DBConfig `env:",prefix=DB_"`
}
Config contains database configuration information.
type DBConfig struct {
User string `env:"USER,default=postgres"`
Pass string `env:"PASS,default=postgres"`
Host string `env:"HOST,default=localhost"`
Name string `env:"NAME,default=postgres"`
Port int `env:"PORT,default=5432"`
}
DBConfig contains database connection settings.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.