package
Version:
v1.8.2
Opens a new window with list of versions in this module.
Published: Sep 1, 2026
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package postgres 提供基于 gorm 的 Postgres 测试便利封装。
gorm/pgx 客户端依赖囚于本包;仅需连接信息的调用方请用父包 testx.NewPostgres,
不受本包依赖传染。
NewDB 在独立的随机名测试库上交付 *gorm.DB。
建表不归本函数管:是否迁移、迁移何表属业务决策,由调用方经各自 store 的 AutoMigrate 完成。
连接池刻意调小:测试库众多,避免容器内连接耗尽。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.