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: 17 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 NewMySQLDB

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

NewMySQLDB returns a new MySQL database client.

type MySQLDB

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

A MySQLDB client.

func (MySQLDB) Exec

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

Exec the supplied query.

func (MySQLDB) Scan

func (c MySQLDB) 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