testapp

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package testapp 提供使用 app 全局访问方式的测试数据库环境。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(t testing.TB, driver, dsn string, models ...any) *dbx.DB

NewDB 使用调用方注册的驱动打开测试数据库、迁移传入的 Model,并在测试结束时自动释放资源。 使用 app.DB 的测试依赖进程级数据库状态,不得并行运行。

Types

This section is empty.

Jump to

Keyboard shortcuts

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