sqlmock

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package sqlmock provides functionalities for mocking a sql.DB connection.

Index

Constants

This section is empty.

Variables

View Source
var New = sqlmock.New

New creates sqlmock database connection and a mock to manage expectations.

View Source
var NewResult = sqlmock.NewResult

NewResult creates a new sql driver Result for Exec based query mocks.

View Source
var NewRows = sqlmock.NewRows

NewRows allows Rows to be created from a sql driver.Value slice or from the CSV string and to be used as sql driver.Rows.

Functions

func DriverContext

func DriverContext(mocks ...func(Sqlmock)) driver.DriverContext

DriverContext creates a new driver.DriverContext.

Types

type Sqlmock

type Sqlmock = sqlmock.Sqlmock

Sqlmock interface.

type Sqlmocker

type Sqlmocker func(t testing.TB) string

Sqlmocker mocks and returns a sqlmock instance.

func Register

func Register(mocks ...func(m Sqlmock)) Sqlmocker

Register creates a new sqlmock instance and returns the dsn to connect to it.

Jump to

Keyboard shortcuts

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