testsql

package
v0.0.9 Latest Latest
Warning

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

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

Documentation

Overview

Package testsql contains the primary mechanism for connecting to a database container for unit or other functional testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionError added in v0.0.9

type ConnectionError error

type Database

type Database interface {
	DataSourceName(string) string
	ContainerImage() string
	ContainerName() string
	Port() int
	PortWithProtocol() string
	Env() []string
}

type TestConnector

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

func New

func New(ctx context.Context, t *testing.T, dbConn Database, host string) (*TestConnector, func())

func (*TestConnector) ContainerConfig added in v0.0.9

func (tc *TestConnector) ContainerConfig() *container.Config

func (*TestConnector) DataSourceName

func (tc *TestConnector) DataSourceName() string

func (*TestConnector) HostConfig added in v0.0.9

func (tc *TestConnector) HostConfig() *container.HostConfig

Directories

Path Synopsis
Package container contains functions and methods for starting a container.
Package container contains functions and methods for starting a container.
Package postgres contains the basic definition for connection to a postgres based container
Package postgres contains the basic definition for connection to a postgres based container

Jump to

Keyboard shortcuts

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