postgres

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BeginTransactionFailedMsg = "failed to begin transaction"
	DbConnectionFailedMsg     = "db connection failed"
	DeleteQueryFailedMsg      = "delete query failed"
	InsertQueryFailedMsg      = "insert query failed"
	SettingNodeFailedMsg      = "unable to set db node"
)

Variables

This section is empty.

Functions

func ErrBeginTransactionFailed

func ErrBeginTransactionFailed(beginErr error) error

func ErrDBConnectionFailed

func ErrDBConnectionFailed(connectErr error) error

func ErrDBDeleteFailed

func ErrDBDeleteFailed(deleteErr error) error

func ErrDBInsertFailed

func ErrDBInsertFailed(insertErr error) error

func ErrUnableToSetNode

func ErrUnableToSetNode(setErr error) error

Types

type DB

type DB struct {
	*sqlx.DB
	Node   core.Node
	NodeID int64
}

func NewDB

func NewDB(databaseConfig config.Database, node core.Node) (*DB, error)

func (*DB) CreateNode

func (db *DB) CreateNode(node *core.Node) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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