testdb

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 12 Imported by: 1 module, 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 testdb gives each test a base of its own, in memory, with the schema. With CALLBACK_TEST_PG set to a Postgres URL, the base is a schema of its own in that Postgres instead, dropped at the end of the test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Account added in v0.6.0

func Account(t testing.TB, db bun.IDB, name string) context.Context

Account creates the account name in db and returns a ctx acting for it. No real password: hashing one would only slow the tests down; setpassword sets one.

func New

func New(t testing.TB) *bun.DB

New is an empty base with the schema, closed at the end of t.

Types

This section is empty.

Jump to

Keyboard shortcuts

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