Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package postgres 提供基于 gorm 的 Postgres 测试便利封装。 gorm/pgx 客户端依赖囚于本包;仅需连接信息的调用方请用父包 testx.NewPostgres, 不受本包依赖传染。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(t *testing.T) *gorm.DB

NewDB 在独立的随机名测试库上交付 *gorm.DB。 建表不归本函数管:是否迁移、迁移何表属业务决策,由调用方经各自 store 的 AutoMigrate 完成。 连接池刻意调小:测试库众多,避免容器内连接耗尽。

Types

This section is empty.

Jump to

Keyboard shortcuts

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