sqlitetest

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: EUPL-1.2 Imports: 7 Imported by: 0

Documentation

Overview

Package sqlitetest provides a helper for opening in-memory SQLite test databases with consistent configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDB

func OpenDB(t *testing.T) *bun.DB

OpenDB returns a file-backed SQLite *bun.DB for testing. It creates the database in t.TempDir() so it is automatically cleaned up. A file-backed database avoids the data-loss hazard of :memory: databases whose content disappears when the connection pool closes and reopens a connection. The database is closed automatically when the test finishes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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