drivertest

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package drivertest contains a common test suite for all SQL drivers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DSN added in v0.3.2

func DSN(driver string) string

DSN returns the DSN for the test database to use with the given SQL driver.

func Declare

func Declare(
	d pksql.Driver,
	setup func(context.Context) *sql.DB,
)

Declare declares generic behavioral tests for a specific driver implementation.

func MockDB added in v0.3.0

func MockDB() *sql.DB

MockDB returns a database pool that uses the mock connector.

func Open added in v0.3.2

func Open(driver string) *sql.DB

Open returns the test database to use with the given driver.

Types

type MockConnector added in v0.3.0

type MockConnector struct {
	driver.Connector
}

MockConnector is mock of the driver.Connector interface.

func (*MockConnector) Driver added in v0.3.0

func (*MockConnector) Driver() driver.Driver

Driver returns the connector's driver.

type MockDriver added in v0.3.0

type MockDriver struct {
	driver.Driver
}

MockDriver is mock of the driver.Driver interface.

Jump to

Keyboard shortcuts

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