db

package
v0.0.0-...-0dd3649 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONNECTION_FORMAT = "%s://%s:%s@%s/%s?sslmode=%s"
)

Variables

This section is empty.

Functions

func Connect

func Connect(connStr *string) error

func ConnectionString

func ConnectionString() string

func Disconnect

func Disconnect() error

Types

type Conn

type Conn struct {
	*sql.DB
}

func (*Conn) Begin

func (conn *Conn) Begin() (Transaction, error)

func (*Conn) Prepare

func (conn *Conn) Prepare(query string) (Statement, error)

type Connection

type Connection interface {
	Begin() (Transaction, error)
	Ping() error
	// contains filtered or unexported methods
}

type Statement

type Statement interface {
	Exec(...interface{}) (sql.Result, error)
	Query(...interface{}) (*sql.Rows, error)
	QueryRow(...interface{}) *sql.Row
	// contains filtered or unexported methods
}

type Stmt

type Stmt struct {
	*sql.Stmt
}

type Transaction

type Transaction interface {
	Commit() error
	Rollback() error
	Stmt(stmt *Stmt) Statement
	// contains filtered or unexported methods
}

func Begin

func Begin() (Transaction, error)

type Tx

type Tx struct {
	*sql.Tx
}

func (*Tx) Prepare

func (tx *Tx) Prepare(query string) (Statement, error)

func (*Tx) Stmt

func (tx *Tx) Stmt(stmt *Stmt) Statement

Jump to

Keyboard shortcuts

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