db

package
v0.0.0-...-544319d Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(host string, port int, schema, user, password string) (err error)

Connect the database for use.

func Execute

func Execute(qry string, args ...interface{}) (err error)

Execute is used to run a query without regard for the result.

func GetVersion

func GetVersion(key string) (version int)

GetVersion number for a particular schema.

func IsNull

func IsNull(id string) bool

IsNull returns true if the passed ID matches a NULL database ID.

func SetVersion

func SetVersion(key string, version int) error

SetVersion number for a particular schema.

Types

type Result

type Result struct {
	// contains filtered or unexported fields
}

Result contains the result of a single query.

func Query

func Query(qry string, args ...interface{}) (result *Result, err error)

Query is used to retrieve a result from a single query execution.

func (*Result) Free

func (result *Result) Free()

Free the result to prevent connection leaks.

func (*Result) ScanNextRow

func (result *Result) ScanNextRow(destinations ...interface{}) bool

ScanNextRow places the SQL query results into the passed destinations and returns true on success.

Jump to

Keyboard shortcuts

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