gorm

package
v1.0.99 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 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 Column added in v1.0.97

type Column struct {
	Name      string
	Key       bool
	Insert    bool
	Update    bool
	Md5       bool
	Upper     bool
	Lower     bool
	Omitempty 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) Exist

func (c Columns) Exist(col string) bool

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 {
	OmitColumnEmpty bool
	Delete          Delete
}

type Table

type Table struct {
	TableName string
	CRUD      string
	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

Jump to

Keyboard shortcuts

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