database

package
v0.0.0-...-ea9caee Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDoesNotExist

func IsDoesNotExist(err error) bool

IsDoesNotExist returns true if the supplied error indicates a database does not exist.

func Setup

func Setup(mgr ctrl.Manager, l logging.Logger) error

Setup adds a controller that reconciles Database managed resources.

Types

type DB

type DB interface {
	Exec(ctx context.Context, q Query) error
	Scan(ctx context.Context, q Query, dest ...interface{}) error
}

A DB client.

func NewPostgresDB

func NewPostgresDB(creds map[string][]byte) DB

NewPostgresDB returns a new PostgreSQL database client.

type PostgresDB

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

A PostgresDB client.

func (PostgresDB) Exec

func (c PostgresDB) Exec(ctx context.Context, q Query) error

Exec the supplied query.

func (PostgresDB) Scan

func (c PostgresDB) Scan(ctx context.Context, q Query, dest ...interface{}) error

Scan the results of the supplied query into the supplied destination.

type Query

type Query struct {
	String     string
	Parameters []interface{}
}

A Query that may be run against a DB.

Jump to

Keyboard shortcuts

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