Documentation ¶
Index ¶
- Variables
- func Connect(options ...module.Option) error
- func Driver(driver DBType) module.Option
- func GetInfo() *sqlinfo
- func Hostname(host string) module.Option
- func Name(name string) module.Option
- func Options(options string) module.Option
- func Password(pass string) module.Option
- func Port(port string) module.Option
- func ReadConfig() (err error)
- func Username(user string) module.Option
- type DBType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DB is the database reference created by "database/sql" DB *db.DB )
Functions ¶
func Connect ¶
Connect accepts options as-needed and connects to the SQL instance depending on the driver being used. Returns an error
func ReadConfig ¶
func ReadConfig() (err error)
ReadConfig is a helper function that retrieves the Username, Password, Database, Host, and Port from the module Configuration file and sets the info
Types ¶
Click to show internal directories.
Click to hide internal directories.