orm

package
v0.0.0-...-3bf2efb Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MulanPSL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBytes

func GetBytes(key interface{}) []byte

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(driver, source string) (e *Engine, err error)

func (*Engine) BulkInsert

func (e *Engine) BulkInsert(list interface{}) (int64, error)

func (*Engine) Close

func (e *Engine) Close() error

func (*Engine) Count

func (e *Engine) Count() (int64, error)

func (*Engine) Delete

func (e *Engine) Delete(i interface{}) (int64, error)

func (*Engine) Get

func (e *Engine) Get(itemPtr interface{}) error

func (*Engine) GetTable

func (e *Engine) GetTable() string

func (*Engine) Insert

func (e *Engine) Insert(list interface{}) (int64, error)

func (*Engine) InsertOne

func (e *Engine) InsertOne(i interface{}) (int64, error)

func (*Engine) List

func (e *Engine) List(listPtr interface{}) error

func (*Engine) ShowSql

func (e *Engine) ShowSql(showSql bool)

func (*Engine) Table

func (e *Engine) Table(table string) *Engine

func (*Engine) Update

func (e *Engine) Update(i interface{}) (int64, error)

func (*Engine) Where

func (e *Engine) Where(condition string, arg interface{}) *Engine

func (*Engine) WhereIf

func (e *Engine) WhereIf(condition string, arg interface{}, conditionTrue bool) *Engine

type Field

type Field struct {
	Name     string
	Type     reflect.Type
	Tag      string
	AutoIncr bool
	IsPk     bool
}

type Schema

type Schema struct {
	Name        string
	ModelType   reflect.Type
	Value       reflect.Value
	NumField    int
	FieldNames  []string
	Fields      []Field
	PkField     *Field
	AutoPkField *Field
}

func NewSchema

func NewSchema(val interface{}) *Schema

func (*Schema) GetFieldStringValue

func (s *Schema) GetFieldStringValue(destValue reflect.Value, field Field) interface{}

func (*Schema) GetFieldValue

func (s *Schema) GetFieldValue(destValue reflect.Value, field Field) interface{}

func (*Schema) GetInsertRecordValues

func (s *Schema) GetInsertRecordValues(dest interface{}) []interface{}

func (*Schema) GetRecordValues

func (s *Schema) GetRecordValues(dest interface{}) []interface{}

func (*Schema) GetUpdateFieldNames

func (s *Schema) GetUpdateFieldNames() []string

func (*Schema) GetUpdateRecordValues

func (s *Schema) GetUpdateRecordValues(dest interface{}) []interface{}

Jump to

Keyboard shortcuts

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