gorm

package
v1.0.166 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrimaryKey

func GetPrimaryKey(table interface{}) []string

func GetTable

func GetTable(table interface{}) string

Types

type ActionType added in v1.0.101

type ActionType int
const (
	A_Insert ActionType = iota
	A_Update
	A_Delete
)

type Column added in v1.0.97

type Column struct {
	Name        string
	PrimaryKey  bool
	UniqueKey   bool
	Required    bool
	Insert      bool
	Update      bool
	Delete      bool
	Where       bool
	TimeNow     bool
	Md5         bool
	Upper       bool
	Lower       bool
	AutoGuid    bool
	Omitempty   bool
	Nullempty   bool
	ActionType  bool
	ReturnValue bool
}

func NewColumn added in v1.0.97

func NewColumn(name string) *Column

type Columns

type Columns []*Column

func (Columns) CountKeys added in v1.0.97

func (c Columns) CountKeys() int

func (Columns) CountReturn added in v1.0.106

func (c Columns) CountReturn() int

func (Columns) Exist

func (c Columns) Exist(col string) bool

type DB added in v1.0.106

type DB int
const (
	DB_Oracle DB = iota
	DB_Postgres
)

type Delete added in v1.0.96

type Delete int
const (
	D_Remove Delete = iota
	D_Disable
)

type Options added in v1.0.95

type Options struct {
	Delete Delete
	Db     DB
}

type Table

type Table struct {
	TableName  string
	ActionType ActionType
	Columns    Columns
	Options    Options
	// contains filtered or unexported fields
}

func NewTable

func NewTable(table interface{}) *Table

func (*Table) GetColumns

func (tb *Table) GetColumns() Columns

func (*Table) GetTableName

func (tb *Table) GetTableName() string

func (*Table) SqlDelete

func (tb *Table) SqlDelete() (string, error)

func (*Table) SqlInsert

func (tb *Table) SqlInsert() (string, error)

func (*Table) SqlStatus added in v1.0.95

func (tb *Table) SqlStatus() (string, error)

func (*Table) SqlUpdate

func (tb *Table) SqlUpdate() (string, error)

func (*Table) Validate added in v1.0.95

func (tb *Table) Validate() error

func (*Table) ValidateRequired added in v1.0.162

func (tb *Table) ValidateRequired() error

Jump to

Keyboard shortcuts

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