sql

package
v3.15.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2018 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Connect and execute patch

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseConfig

type DatabaseConfig struct {
	SqlxDb     *sqlx.DB
	SqlxDbCtrl *osqlx.DbController
	// contains filtered or unexported fields
}

Represents the connection information to database

func NewDatabaseConfig

func NewDatabaseConfig(driverName string, dsn string) (dbConfig *DatabaseConfig, err error)

Initialize a new configuration to database This function also tries to ping the database

func (*DatabaseConfig) Close

func (databaseConfig *DatabaseConfig) Close() error

Close the db resource hold by the DatabaseConfig

func (*DatabaseConfig) Execute

func (databaseConfig *DatabaseConfig) Execute(
	dbCallback func(db *dbsql.DB) error,
) (err error)

Execute a callback which accepts "database/sql.DB" object

func (*DatabaseConfig) GetDatabaseName

func (c *DatabaseConfig) GetDatabaseName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL