rexDatabase

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

*

@author: taco
@Date: 2023/8/15
@Time: 10:37

*

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(db *sql.DB)

func NewDbClient

func NewDbClient(c *DbConfig) (*gorm.DB, error)

func NewGormZapLogger

func NewGormZapLogger() gormLogger.Interface

func NewPgDbClient

func NewPgDbClient(c *PgDbConfig) (*gorm.DB, error)

Types

type AuditByStringModel

type AuditByStringModel struct {
	CreatedBy string `gorm:"index:idx_created_by;column:created_by;comment:创建者;type: varchar(255)" json:"created_by"`
	UpdatedBy string `gorm:"index:idx_updated_by;column:updated_by;comment:更新者;type: varchar(255)" json:"updated_by"`
	DeletedBy string `gorm:"index:idx_deleted_by;column:deleted_by;comment:删除者;type: varchar(255)" json:"-"`
}

note: 审计字段新版实现

type AuditByUintModel

type AuditByUintModel struct {
	CreatedBy uint `gorm:"index:idx_created_by;column:created_by;comment:创建者;type:int" json:"created_by"`
	UpdatedBy uint `gorm:"index:idx_updated_by;column:updated_by;comment:更新者;type:int" json:"updated_by"`
	DeletedBy uint `gorm:"index:idx_deleted_by;column:deleted_by;comment:删除者;type:int" json:"-"`
}

type AuditRpcByStringModel

type AuditRpcByStringModel struct {
	CreatedBy string `gorm:"index:idx_created_by;column:created_by;comment:创建者;type: varchar(255)" json:"createdBy"`
	UpdatedBy string `gorm:"index:idx_updated_by;column:updated_by;comment:更新者;type: varchar(255)" json:"updatedBy"`
	DeletedBy string `gorm:"index:idx_deleted_by;column:deleted_by;comment:删除者;type: varchar(255)" json:"-"`
}

type AuditRpcByUintModel

type AuditRpcByUintModel struct {
	CreatedBy string `gorm:"index:idx_created_by;column:created_by;comment:创建者;type:int" json:"createdBy"`
	UpdatedBy string `gorm:"index:idx_updated_by;column:updated_by;comment:更新者;type:int" json:"updatedBy"`
	DeletedBy string `gorm:"index:idx_deleted_by;column:deleted_by;comment:删除者;type:int" json:"-"`
}

type AuditTenantByStringModel

type AuditTenantByStringModel struct {
	CreatedTenantBy string `` /* 133-byte string literal not displayed */
	UpdatedTenantBy string `` /* 133-byte string literal not displayed */
	DeletedTenantBy string `gorm:"index:idx_deleted_tenant_by;column:deleted_tenant_by;comment:删除数据的租户;type: varchar(255)" json:"-"`
}

note: 审计模型租户版

type AuditTenantByUintModel

type AuditTenantByUintModel struct {
	CreatedTenantBy uint `gorm:"index:idx_created_tenant_by;column:created_tenant_by;comment:创建数据的租户;type:int" json:"created_tenant_by"`
	UpdatedTenantBy uint `gorm:"index:idx_updated_tenant_by;column:updated_tenant_by;comment:更新数据的租户;type:int" json:"updated_tenant_by"`
	DeletedTenantBy uint `gorm:"index:idx_deleted_tenant_by;column:deleted_tenant_by;comment:删除数据的租户;type:int" json:"-"`
}

type AuditTenantRpcByStringModel

type AuditTenantRpcByStringModel struct {
	CreatedTenantBy string `` /* 131-byte string literal not displayed */
	UpdatedTenantBy string `` /* 131-byte string literal not displayed */
	DeletedTenantBy string `gorm:"index:idx_deleted_tenant_by;column:deleted_tenant_by;comment:删除数据的租户;type: varchar(255)" json:"-"`
}

type AuditTenantRpcByUintModel

type AuditTenantRpcByUintModel struct {
	CreatedTenantBy uint `gorm:"index:idx_created_tenant_by;column:created_tenant_by;comment:创建数据的租户;type:int" json:"createdTenantBy"`
	UpdatedTenantBy uint `gorm:"index:idx_updated_tenant_by;column:updated_tenant_by;comment:更新数据的租户;type:int" json:"updatedTenantBy"`
	DeletedTenantBy uint `gorm:"index:idx_deleted_tenant_by;column:deleted_tenant_by;comment:删除数据的租户;type:int" json:"-"`
}

type BaseAdminModel

type BaseAdminModel struct {
	CreatedBy uint `gorm:"column:created_by;comment:创建者;type: int" json:"created_by"`
	UpdatedBy uint `gorm:"column:updated_by;comment:更新者;type: int" json:"updated_by"`
	DeletedBy uint `gorm:"column:deleted_by;comment:删除者;type: int" json:"-"`
}

type BaseModel

type BaseModel struct {
	ID        uint           `gorm:"primarykey" json:"id"`
	CreatedAt time.Time      `gorm:"column:created_at;comment:创建时间;" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;comment:更新时间;" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}

note: 兼容实现

type BaseRpcModel

type BaseRpcModel struct {
	ID        uint           `gorm:"primarykey" json:"id"`
	CreatedAt time.Time      `gorm:"column:created_at;comment:创建时间;" json:"createdAt"`
	UpdatedAt time.Time      `gorm:"column:updated_at;comment:更新时间;" json:"updatedAt"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}

note: rpc新版实现

type BaseTenantModel

type BaseTenantModel struct {
	CreatedTenantBy string `` /* 133-byte string literal not displayed */
	UpdatedTenantBy string `` /* 133-byte string literal not displayed */
	DeletedTenantBy string `gorm:"index:idx_deleted_tenant_by;column:deleted_tenant_by;comment:删除数据的租户;type: varchar(255)" json:"-"`
}

type DbConfig

type DbConfig struct {
	Host                 string
	Port                 uint
	DbName               string
	User                 string
	Password             string
	Charset              string
	MaxIdle              int
	MaxOpen              int
	LogMode              bool
	Loc                  string
	MaxLifetime          int64
	TablePrefix          string
	Debug                bool
	AllowNativePasswords bool
}

type PgDbConfig

type PgDbConfig struct {
	Host        string
	User        string
	Password    string
	DbName      string
	Port        uint
	SslMode     string
	Loc         string
	Debug       bool
	TablePrefix string
	MaxIdle     int
	MaxOpen     int
	MaxLifetime int64
}

type UniqueIdAdminModel

type UniqueIdAdminModel struct {
	CreatedBy string `gorm:"index:idx_created_by;column:created_by;comment:创建者;type: varchar(255)" json:"created_by"`
	UpdatedBy string `gorm:"index:idx_updated_by;column:updated_by;comment:更新者;type: varchar(255)" json:"updated_by"`
	DeletedBy string `gorm:"index:idx_deleted_by;column:deleted_by;comment:删除者;type: varchar(255)" json:"-"`
}

Jump to

Keyboard shortcuts

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