postgres

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

package picker provided structures and method to manage injected variable system for Godog.

It allows an user to pick value into a store and inject them in steps through a variable replacement.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnmatched = errors.New("some conditions are not met")

ErrUnmatched indicates that some expected assertions are not met.

Functions

func Debug

func Debug() error

Debug activate debug logs.

func NoLog

func NoLog()

NoLog disable logging under Fatal level.

func Reset

func Reset() error

Reset matcher instance.

func ResetLog

func ResetLog()

ResetLog activate debug logs.

Types

type DB

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

DB provides a structure to manage postgres databases.

func Database

func Database(name string, db *sql.DB, store *picker.Store) *DB

Database initializes a DB instance for postgres. It will persist instance using provided name to be injectable through {{pg.name}} in gherkin steps. Providing an empty picker does not impact initialization. It will just not picked the instance. You can always call DB.Persist to save database instance in a picker store.

func (DB) AssertData

func (db DB) AssertData(data *godog.Table) error

AssertData asserts provided data from godog table matches provided conditions in database.

func (DB) Persist

func (db DB) Persist(store *picker.Store)

Persist persists database instance through picker instance using pg.name key.

func (DB) PickField

func (db DB) PickField(store *picker.Store, table, field, key string, identifiedBy *godog.Table) (err error)

func (*DB) SeedFromFile

func (db *DB) SeedFromFile(filePath string, store *picker.Store) (err error)

SeedFromFile executes an SQL file content into known postgres database.

Jump to

Keyboard shortcuts

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