inspecttest

package
v0.5.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: PostgreSQL Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package inspecttest is a database/sql driver that answers queries from a script, so a command that runs an inspect analysis can be tested without a Postgres.

Index

Constants

View Source
const DriverName = "inspectfake"

DriverName is the name the fake is registered under.

Variables

This section is empty.

Functions

func Open

func Open(t *testing.T) *sql.DB

Open returns a *sql.DB on the fake, closed when the test ends.

func Opener

func Opener(t *testing.T, seen *string) func(context.Context, string) (*sql.DB, error)

Opener is an inspect opener that ignores the URL and returns the fake, recording the URL it was handed.

func Script

func Script(t *testing.T, key string, r Result)

Script registers an answer for statements containing key, for the life of the test.

Types

type Result

type Result struct {
	Cols []string
	Rows [][]driver.Value
	Err  error
}

Result is one scripted answer: the columns and rows to return, or the error to fail with.

Jump to

Keyboard shortcuts

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