Documentation ¶
Index ¶
- Variables
- type Postgres
- func (pg *Postgres) AssertData(instance string, data *godog.Table) error
- func (pg *Postgres) AssertDataDoesNotExists(instance string, data *godog.Table) error
- func (Postgres) Debug() error
- func (Postgres) DisableDebug() error
- func (pg *Postgres) Reset()
- func (pg *Postgres) StoreField(field, instance, table, key string, data *godog.Table) error
- type PostgresInfo
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnknown is raised when trying to operate on // an unpicked database. ErrUnknown = errors.New("unknown database") // ErrInvalidInstance is raised when trying to // operate on a non postgresql instance. ErrInvalidInstance = errors.New("expected Postgres instance") ErrUnexpectedData = errors.New("data should not exists in instance") )
Functions ¶
This section is empty.
Types ¶
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
Postgres manages instance for kactus Postgres and provides tools to manipulate and asserts on known postgres databases.
func NewPostgres ¶
func NewPostgres(pickerInstance *picker.Picker, databases ...PostgresInfo) *Postgres
NewPostgres initializes a postgres kactus manager for provided postgres database instances. It relies on a singleton pattern so successive call to NewPostgres will return the same instance
func (*Postgres) AssertData ¶
AssertData asserts data exists in provided table for known db instance using provided where clauses.
func (*Postgres) AssertDataDoesNotExists ¶
AssertDataDoesNotExists asserts data does not exists in provided table for known db instance using provided where clauses.
type PostgresInfo ¶
PostgresInfo provides a structure to register a new postgres instance to kactus.
Key will be used to to pick instance. `pg.` will be append to provided key when picking.
DB indicates *sql.DB instance to store under proved key.