# README
upper.io/db.v3 Module for Helium
Default modules
- MySQL - to connection
database.mysql
- PG - to connection
database.postgres
Example configuration
database:
mysql:
adapter: mysql
hostname: 127.0.0.1:3306
database: mysql
username: root
password:
debug: true
options:
parseTime: true
postgres:
adapter: postgres
hostname: 127.0.0.1:5432
database: postgres
username: postgres
password: postgres
debug: true
options:
sslmode: disable
mssql:
adapter: mssql
hostname: 127.0.0.1:1433
database: master
username: test
password: test
debug: true
mongo:
adapter: mongo
hostname: 127.0.0.1:27017
database: master
username: test
password: test
debug: true
# Functions
Adapter pass connection adapter into options.
Config pass connection url into options.
Debug enable connection debug.
Logger pass connection logger into options.
NewConnection creates new database connection by adapter and config
if cfg contains debug, than enable logging and replace default logger by zap.Logger.
PrepareConfig prepare options for connection.
# Constants
ErrConfigNotFound throws when config key is empty or not set.
ErrEmptyAdapter throws when passed empty adapter into NewConnection.
ErrEmptyConfig throws when db.ConnectionURL not passed into NewConnection.
ErrUnknownAdapter throws when passed unknown adapter into NewConnection.
# Variables
MySQLModule default connection to mysql.
PostgresModule default connection to postgres.
# Structs
No description provided by the author
No description provided by the author