fakedb

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fakedb provides a minimal fake implementation for a database/sql database, to be used in tests.

Index

Constants

View Source
const (
	QueryNoRows = "SELECT 1 WHERE FALSE"
	QueryOneRow = "SELECT 1"
	QueryError  = "INVALID QUERY"
	ErrorMsg    = "invalid query"
)

Queries supported by the fake database. Each query will return a different number of rows, but no actual content.

Variables

This section is empty.

Functions

func Open

func Open(*FakeDB) (*sql.DB, error)

Open creates a new sql.DB object that supports the queries defined in fakedb.

Types

type FakeDB

type FakeDB struct{}

FakeDB is a fake implementation of sql.DB.

Jump to

Keyboard shortcuts

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