Documentation ¶
Index ¶
- func CombineSimpleQuery(elements []ConditionElement, relation Relation) (string, []interface{})
- func GetDbIdFields(d *ast.Definition, fieldName string) string
- func GetNestedPreloadSelection(data PreloadFields, dbObj *gorm.DB) *gorm.DB
- func GetNestedPreloads(ctx *graphql.OperationContext, fields []graphql.CollectedField, prefix string) (preloads []string)
- func GetPreloadSelection(ctx context.Context, dbObj *gorm.DB, data PreloadFields) *gorm.DB
- func GetPreloadString(prefix, name string) string
- func GetPreloads(ctx context.Context) []string
- func GetQuoteChar(db *gorm.DB) string
- func ShouldFieldBeIgnored(d *ast.Definition, fieldName string) bool
- type Clausel
- type ConditionElement
- func Between(field string, start, end interface{}) ConditionElement
- func Complex(relation Relation, elems ...ConditionElement) ConditionElement
- func Equal(field string, value interface{}) ConditionElement
- func In(field string, value interface{}) ConditionElement
- func Less(field string, value interface{}) ConditionElement
- func LessOrEqual(field string, value interface{}) ConditionElement
- func Like(field string, value interface{}) ConditionElement
- func More(field string, value interface{}) ConditionElement
- func MoreOrEqual(field string, value interface{}) ConditionElement
- func NewConditionElement(operator, field string, value ...interface{}) ConditionElement
- func NotEqual(field string, value interface{}) ConditionElement
- func NotIn(field string, value interface{}) ConditionElement
- func NotLike(field string, value interface{}) ConditionElement
- func NotNull(field string, value interface{}) ConditionElement
- func Null(field string, value interface{}) ConditionElement
- type PreloadFields
- type Relation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombineSimpleQuery ¶
func CombineSimpleQuery(elements []ConditionElement, relation Relation) (string, []interface{})
func GetDbIdFields ¶
func GetDbIdFields(d *ast.Definition, fieldName string) string
func GetNestedPreloadSelection ¶
func GetNestedPreloadSelection(data PreloadFields, dbObj *gorm.DB) *gorm.DB
func GetNestedPreloads ¶
func GetNestedPreloads(ctx *graphql.OperationContext, fields []graphql.CollectedField, prefix string) (preloads []string)
func GetPreloadSelection ¶
func GetPreloadString ¶
func GetPreloads ¶
func GetQuoteChar ¶ added in v0.1.0
func ShouldFieldBeIgnored ¶
func ShouldFieldBeIgnored(d *ast.Definition, fieldName string) bool
Types ¶
type Clausel ¶
type Clausel = string
const ( Clausel_Eq Clausel = "eq" Clausel_Eqi Clausel = "eqi" Clausel_Ne Clausel = "ne" Clausel_StartsWith Clausel = "startsWith" Clausel_EndsWith Clausel = "endsWith" Clausel_Contains Clausel = "contains" Clausel_NotContains Clausel = "notContains" Clausel_NotContainsI Clausel = "notContainsi" Clausel_ContainsI Clausel = "containsi" Clausel_Null Clausel = "null" Clausel_NotNull Clausel = "notNull" Clausel_IN Clausel = "in" Clausel_NotIN Clausel = "noIn" )
type ConditionElement ¶
type ConditionElement struct { Operator string `json:"operator,omitempty"` Field string `json:"field,omitempty"` Value []interface{} `json:"value,omitempty"` Children []ConditionElement `json:"children,omitempty"` ChildrenRelation Relation `json:"children_relation,omitempty"` }
func Between ¶
func Between(field string, start, end interface{}) ConditionElement
func Complex ¶
func Complex(relation Relation, elems ...ConditionElement) ConditionElement
func Equal ¶
func Equal(field string, value interface{}) ConditionElement
func In ¶
func In(field string, value interface{}) ConditionElement
func Less ¶
func Less(field string, value interface{}) ConditionElement
func LessOrEqual ¶
func LessOrEqual(field string, value interface{}) ConditionElement
func Like ¶
func Like(field string, value interface{}) ConditionElement
func More ¶
func More(field string, value interface{}) ConditionElement
func MoreOrEqual ¶
func MoreOrEqual(field string, value interface{}) ConditionElement
func NewConditionElement ¶
func NewConditionElement(operator, field string, value ...interface{}) ConditionElement
func NotEqual ¶
func NotEqual(field string, value interface{}) ConditionElement
func NotIn ¶
func NotIn(field string, value interface{}) ConditionElement
func NotLike ¶
func NotLike(field string, value interface{}) ConditionElement
func NotNull ¶
func NotNull(field string, value interface{}) ConditionElement
func Null ¶
func Null(field string, value interface{}) ConditionElement
type PreloadFields ¶
type PreloadFields struct { Fields []string TableName string SubTables []PreloadFields PreloadName string }
func GetNestedPreloadsMap ¶
func GetNestedPreloadsMap(ctx *graphql.OperationContext, fields []graphql.CollectedField, tableName, parentTableName string) PreloadFields
func GetPreloadsMap ¶
func GetPreloadsMap(ctx context.Context, tableName string) PreloadFields
Click to show internal directories.
Click to hide internal directories.