Documentation ¶
Index ¶
- func AssertAndReturnSlice(targetType reflect.Type, value interface{}, e error) ([]interface{}, error)
- func ORMTest()
- type ORM
- func (o *ORM) GetAll() (any, error)
- func (o *ORM) GetByFieldCompare(fieldName string, value any, operator string) (any, error)
- func (o *ORM) GetByFieldEquals(fieldName string, value any) (any, error)
- func (o *ORM) GetByFieldGreaterThan(fieldName string, value any) (any, error)
- func (o *ORM) GetByFieldGreaterThanEquals(fieldName string, value any) (any, error)
- func (o *ORM) GetByFieldIn(fieldName string, values []any) (any, error)
- func (o *ORM) GetByFieldLessThan(fieldName string, value any) (any, error)
- func (o *ORM) GetByFieldLessThanEquals(fieldName string, value any) (any, error)
- func (o *ORM) GetByFieldLike(fieldName string, value any) (any, error)
- func (o *ORM) GetByPrimaryKey(key string) (any, error)
- func (o *ORM) GetCount(fieldName string, value any, operator string) (int, error)
- func (o *ORM) Insert(entity any) error
- func (o *ORM) Update(entity any, primaryKeyValue string) error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertAndReturnSlice ¶ added in v1.2.0
Types ¶
type ORM ¶
type ORM struct {
// contains filtered or unexported fields
}
ORM struct encapsulates the metadata and methods for a table.
func (*ORM) GetByFieldCompare ¶ added in v1.2.0
func (*ORM) GetByFieldEquals ¶ added in v1.2.0
func (*ORM) GetByFieldGreaterThan ¶ added in v1.2.0
func (*ORM) GetByFieldGreaterThanEquals ¶ added in v1.2.0
func (*ORM) GetByFieldIn ¶ added in v1.2.0
func (*ORM) GetByFieldLessThan ¶ added in v1.2.0
func (*ORM) GetByFieldLessThanEquals ¶ added in v1.2.0
func (*ORM) GetByFieldLike ¶ added in v1.2.0
func (*ORM) GetByPrimaryKey ¶
GetByPrimaryKey fetches a row by its primary key.
type Service ¶
type Service struct { TableName string `karma_table:"services"` ServiceId string `json:"service_id" karma:"primary;unique"` Type string `json:"type"` //"local", "online", "offline" Name string `json:"name"` Icon string `json:"icon"` Banner string `json:"banner"` Category string `json:"category"` // "food", "clothing", "electronics", "services", "entertainment", "education", "health", "beauty", "travel", "venues OfferedBy string `json:"offered_by"` // "global", "service_provider_id" Timestamp time.Time `json:"timestamp"` }
Click to show internal directories.
Click to hide internal directories.