txparam

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 6 Imported by: ? modules, 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 txparam 禁止在函数参数或 struct 字段中显式传递或持有 pgx.Tx。

在 appkit 事务模型中,事务由 tx.Do 回调管理、句柄藏在 context.Context 中, 存储层通过 sqlc.New(pgtx.From(ctx, s.pool)) 自动感知当前事务(DESIGN §5.5)。 显式传递 pgx.Tx 会破坏统一抽象并绕过租户/分区作用域守卫。

默认只查非生成生产代码(_test.go 与生成文件不查),-tests=true 连测试一起查。

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "txparam",
	Doc:  "禁止在函数参数或 struct 字段中传递或持有 pgx.Tx;事务句柄须经 tx.Do 放入 ctx 并由 pgtx.From(ctx, pool) 获取",
	Run:  run,
}

Analyzer 是 txparam 检查器。

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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