Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDSN ¶
func GetDSN(params ConnParams) string
GetDSN generates DSN string from config parameters, which can be overridden in params.
func GetDefaultDSN ¶
func GetDefaultDSN() string
GetDefaultDSN is a wrapper for GetDSN without params.
Types ¶
type ConnData ¶
type ConnData struct {
DB *sqlx.DB
Logger monitor.ModuleLogger
// contains filtered or unexported fields
}
ConnData holds connection data.
func NewConnection ¶
NewConnection sets up a database object, panics if unable to connect.
func (ConnData) MigrateDown ¶
func (c ConnData) MigrateDown()
MigrateDown undoes the previous migration.
type ConnParams ¶
ConnParams holds database server parameters.
type Connection ¶
type Connection interface {
MigrateUp()
MigrateDown()
}
Connection implements the app database handler.
Click to show internal directories.
Click to hide internal directories.