postgres

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: AGPL-3.0 Imports: 6 Imported by: 79

Documentation

Index

Constants

View Source
const (
	DbConnectionFailedMsg        = "db connection failed"
	SettingNodeFailedMsg         = "unable to set db node"
	ForeignKeyViolationErrorCode = "23503"
)

Variables

View Source
var ErrHeaderDoesNotExist = errors.New("header does not exist")

Functions

func ErrDBConnectionFailed

func ErrDBConnectionFailed(connectErr error) error

func ErrUnableToSetNode

func ErrUnableToSetNode(setErr error) error

func IsForeignKeyViolationErr added in v0.1.1

func IsForeignKeyViolationErr(err error) bool

func UnwrapErrorRecursively added in v0.1.1

func UnwrapErrorRecursively(err 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