Categorygithub.com/nytimes/sqliface
modulepackage
0.0.0-20180310195202-f8e6c8b78d37
Repository: https://github.com/nytimes/sqliface.git
Documentation: pkg.go.dev

# README

sqliface

GoDoc Build Status

sqliface is a package for the Go programming language that contains a set of interfaces and implementations that help make code utilizing database/sql more testable. This package has only been tested with a MySQL database. Pull Requests for utilizing other databases' custom types are appreciated (i.e. mysql.NullTime).

For documentation check out the GoDoc page.

Examples

Check out the examples directory for examples on how to use this package.

# Packages

No description provided by the author

# Functions

NewMockRows will create a new MockRows instance with the given MockRow set.
NewTypeError returns a TypeError instance.

# Structs

MockRows is a set of database rows that implements Rows to help test applications using database/sql.
TypeError is returned by MockRow.Scan when the type it's attempting to scan into does not match the type in the MockRow.

# Interfaces

ExecCloser implements the Execer interface with an additional Close method.
Execer is an interface that both sql.Tx and sql.DB implement.
Row is an interface implemented by sql.Row, sql.Rows, and MockRow.
Rows is an interface implemented by sql.Rows and MockRows.

# Type aliases

MockRow is database row that implements Row to help test applications using database/sql.