meta

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagField      = "dbx"
	MarkPK        = "primaryKey"
	MarkIgnore    = "_"
	MarkTenantKey = "tenantKey"
	MarkIsDeleted = "softDelete"
)

Variables

This section is empty.

Functions

func GetTableName

func GetTableName(v any) string

func GetTypeName

func GetTypeName(v any) string

Types

type Column

type Column struct {
	Name             string
	ColumnName       string
	Type             reflect.Type
	IsPrimaryKey     bool
	IsTenantKey      bool
	IsLogicDeleteKey bool
	Ignore           bool
}

func ListColumns

func ListColumns(t reflect.Type) []*Column

func ListValueColumns

func ListValueColumns(v any) []*Column

func NewColumnDefWith

func NewColumnDefWith(f reflect.StructField) *Column

func (*Column) Format

func (c *Column) Format(buffer *expr.TracedBuffer)

func (*Column) String

func (c *Column) String() string

type Entity

type Entity struct {
	Columns        []*Column
	TableName      string
	Name           string
	Type           reflect.Type
	PrimaryKey     *Column
	TenantKey      *Column
	LogicDeleteKey *Column
}

func NewEntity

func NewEntity(v any) *Entity

func (*Entity) Column

func (m *Entity) Column(name string) *Column

func (*Entity) ColumnExprs

func (m *Entity) ColumnExprs() []expr.Expr

func (*Entity) ColumnName

func (m *Entity) ColumnName(name string) string

ColumnName return column name by field name

func (*Entity) Format

func (m *Entity) Format(buffer *expr.TracedBuffer)

func (*Entity) String

func (m *Entity) String() string

type TableName

type TableName interface {
	TableName() string
}

Jump to

Keyboard shortcuts

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