database

package
v0.0.0-...-bae6b6e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(host string, port int64, user, password, dbname string) (*sqlx.DB, error)

Initialize a new connection to a PostgreSQL database and runs any pending migrations.

Types

type Fixture

type Fixture struct {
	Mock sqlmock.Sqlmock
	DB   *sqlx.DB
	// contains filtered or unexported fields
}

Fixture represents a test fixture for database testing.

func NewFixture

func NewFixture(t *testing.T) *Fixture

NewFixture returns a new instance of Fixture for testing purposes. It creates a new sqlmock database connection and returns a Fixture instance with the sqlmock DB and connection.

func (*Fixture) Teardown

func (f *Fixture) Teardown()

Teardown closes the connection to the mock database.

Jump to

Keyboard shortcuts

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