Documentation ¶
Index ¶
- Variables
- func GetSelector(models interface{}) string
- type IterationTypes
- type Mapper
- type MapperOption
- func (m MapperOption) SetDisableBinding() MapperOption
- func (m MapperOption) SetIterationHashMapWithColumns(pkColumnName []string, storeColumns []string) MapperOption
- func (m MapperOption) SetIterationHashMapWithModel(model interface{}, storeColumns []string) MapperOption
- func (m MapperOption) SetIterationList() MapperOption
- func (m MapperOption) SetOverridePKField(fields ...MapperOptionPkField) MapperOption
- type MapperOptionPkField
- type Registry
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMustNotNil = errors.New("data model must not be nil") ErrMustBeStruct = errors.New("data value must be type struct") ErrFieldNotFound = errors.New("field not found") ErrTagValueNotFound = errors.New("tag value not found") ErrNotIdentifyFkField = errors.New("not identify fk field on tag") ErrRegistryNotFound = errors.New("registry not found") )
View Source
var GlobalRegistry = map[string]Registry{ (uid{}).TypeName(): uid{}, (str("")).TypeName(): str(""), (zerouid{}).TypeName(): zerouid{}, (integer(0)).TypeName(): (integer(0)), (integer64(0)).TypeName(): (integer64(0)), (floater32(float32(0))).TypeName(): (floater32(0)), (floater64(float64(0))).TypeName(): (floater64(0)), (timestamp(helper.Timestamp{})).TypeName(): timestamp(helper.Timestamp{}), (date(helper.Date{})).TypeName(): date(helper.Date{}), (zeroString(zeroString{})).TypeName(): zeroString(zero.String{}), (zeroInt(zero.Int{})).TypeName(): zeroInt(zero.Int{}), (zeroFloat(zero.Float{})).TypeName(): zeroFloat(zero.Float{}), (zeroBool(zero.Bool{})).TypeName(): zeroBool(zero.Bool{}), (boolean(true)).TypeName(): (boolean(true)), }
View Source
var PAGINATE_COLUMN_NAME = "total_row"
View Source
var TABLE_FIELD_NAME = "TableName"
View Source
var TAGNAME = "db"
View Source
var TAG_FK = "fk"
View Source
var TAG_PK = "pk"
View Source
var TAG_TYPE = "type"
Functions ¶
func GetSelector ¶
func GetSelector(models interface{}) string
Types ¶
type IterationTypes ¶
type IterationTypes string
const ( ITERATION_TYPE_LIST IterationTypes = "array_list" ITERATION_TYPE_HASH_MAP IterationTypes = "hash_map" )
type Mapper ¶
type Mapper struct {
// contains filtered or unexported fields
}
func OrmContext ¶
func (Mapper) GetColumns ¶
func (m Mapper) GetColumns() []*sql.ColumnType
func (Mapper) GetIterationHashMap ¶
get(id) -> *hashmap.Map
func (Mapper) GetIterationList ¶
iter -> []interface{}
func (Mapper) GetPaginateTotal ¶
func (Mapper) GetRowCount ¶
type MapperOption ¶
type MapperOption struct {
// contains filtered or unexported fields
}
func NewMapperOption ¶
func NewMapperOption() MapperOption
func (MapperOption) SetDisableBinding ¶
func (m MapperOption) SetDisableBinding() MapperOption
func (MapperOption) SetIterationHashMapWithColumns ¶
func (m MapperOption) SetIterationHashMapWithColumns(pkColumnName []string, storeColumns []string) MapperOption
pkColumnName is column from query to get pk if data is null will be skip that rows | storeOnlyColumn is optional choose store column example []string{"orders.id"}, nil
func (MapperOption) SetIterationHashMapWithModel ¶
func (m MapperOption) SetIterationHashMapWithModel(model interface{}, storeColumns []string) MapperOption
model is column from query to get pk if data is null will be skip that rows | storeOnlyColumn is optional choose store column example new(Order), nil
func (MapperOption) SetIterationList ¶
func (m MapperOption) SetIterationList() MapperOption
Copy rows.Next() -> ArrayList
func (MapperOption) SetOverridePKField ¶
func (m MapperOption) SetOverridePKField(fields ...MapperOptionPkField) MapperOption
type MapperOptionPkField ¶
type MapperOptionPkField struct {
// contains filtered or unexported fields
}
func NewMapperOptionPKField ¶
func NewMapperOptionPKField(model interface{}, fieldname []string) MapperOptionPkField
Click to show internal directories.
Click to hide internal directories.