Documentation
¶
Index ¶
- func AuditHook() ent.Hook
- func RegisterMigrate(fn MigrateFunc)
- func RegisterMigrates(fn ...MigrateFunc)
- func RegisterTableComment(table string, comment string)
- func RegisterTableComments(comments ...TableComment)
- func SetAuditExcludeTypes(types ...string)
- type AuditMixin
- type Client
- type MigrateFunc
- type TableComment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterMigrates ¶
func RegisterMigrates(fn ...MigrateFunc)
RegisterMigrates 注册多个用于数据库迁移的 Ent 迁移函数。
func RegisterTableComment ¶
RegisterTableComment 注册用于迁移后回填的数据库表注释。
func RegisterTableComments ¶
func RegisterTableComments(comments ...TableComment)
RegisterTableComments 注册多个用于迁移后回填的数据库表注释。
func SetAuditExcludeTypes ¶
func SetAuditExcludeTypes(types ...string)
SetAuditExcludeTypes 设置跳过审计字段回填的 Ent 类型名称。
Types ¶
type AuditMixin ¶
AuditMixin 提供 Ent 审计字段与回填 hook。
func (AuditMixin) Annotations ¶
func (AuditMixin) Annotations() []schema.Annotation
Annotations 返回审计字段注释落库配置。
type Client ¶
Client 封装 Ent 底层 dialect.Driver 与 database/sql 连接池。
func NewEntClient ¶
func NewEntClient(cfg *configv1.Data_Database) (*Client, func(), error)
NewEntClient 创建 Ent 数据库客户端。
func (*Client) RunRegisteredMigrations ¶
RunRegisteredMigrations 执行已注册的 Ent 迁移函数。
type MigrateFunc ¶
MigrateFunc 定义 Ent 自动迁移函数。
type TableComment ¶
TableComment 描述 Ent 数据库表注释。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.