sql

package
v0.0.0-...-920d0ee Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2016 License: Apache-2.0 Imports: 2 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 {
	// 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

Jump to

Keyboard shortcuts

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