dbutil

package
v0.0.0-...-8fa2440 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var _, Log = xlog.New("dbutil")

Functions

func InsertEdge

func InsertEdge(dbi DBI, node1ID, node2ID int64, edgeType string, args ...interface{}) error

func InsertKV

func InsertKV(dbi DBI, table string, args ...interface{}) (pgx.CommandTag, error)

func InsertKVR

func InsertKVR(dbi DBI, table, returncol string, args ...interface{}) *pgx.Row

func InsertNode

func InsertNode(dbi DBI, nodeType string, args ...interface{}) (int64, error)

func IsUniqueViolation

func IsUniqueViolation(err error) bool

func NewPgxPool

func NewPgxPool(url string) (*pgx.ConnPool, error)

func UpdateKV

func UpdateKV(dbi DBI, table string, s Set, w Where) (pgx.CommandTag, error)

Types

type DBI

type DBI interface {
	Exec(sql string, args ...interface{}) (pgx.CommandTag, error)
	Query(sql string, args ...interface{}) (*pgx.Rows, error)
	QueryRow(sql string, args ...interface{}) *pgx.Row
}

type Set

type Set map[string]interface{}

type Where

type Where map[string]interface{}

Jump to

Keyboard shortcuts

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