dbcommodi

package
v0.0.0-...-16d328e Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2014 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRows = sql.ErrNoRows

Functions

func ExecQuery

func ExecQuery(db *sql.DB, query string, queryargs ...interface{}) (result sql.Result, err error)

func ExecQueryRow

func ExecQueryRow(db *sql.DB, query string, queryargs ...interface{}) (row *sql.Row)

func ExecQueryWithTransaction

func ExecQueryWithTransaction(stmt *sql.Stmt, args ...interface{}) (result sql.Result, err error)

func GetConn

func GetConn() (*sql.DB, err)

GetConn gets a PostgreSQL connection using ConnVars

func GetSqliteDB

func GetSqliteDB(path string) (db *sql.DB, err error)

Get db connection

func GetTransactionAndStatement

func GetTransactionAndStatement(db *sql.DB, query string) (tx *sql.Tx, stmt *sql.Stmt, err error)

func RunQuery

func RunQuery(db *sql.DB, query string, args ...interface{}) (rows *sql.Rows, err error)

func RunQueryWithTransaction

func RunQueryWithTransaction(stmt *sql.Stmt, args ...interface{}) (rows *sql.Rows, err error)

func ScanRow

func ScanRow(row *sql.Row, scanargs ...interface{}) (err error)

Types

type ConnVars

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

ConnVars is used as variables for postgres connection

func New

func New() *ConnVars

New initiates ConnVars with default values

func (*ConnVars) SetVars

func (cv *ConnVars) SetVars(dbname, user, password, host, port, sslmode)

SetVars sets the connection variables

Jump to

Keyboard shortcuts

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