querygen

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ObjQuery = `` /* 200-byte string literal not displayed */

	ObjsQuery = `` /* 221-byte string literal not displayed */

	ReverseEdgeQuery = `
  %s: ~%s {
			gid: uid
			expand(_all_)
			dgraph.type
		}
  `

	SchemaQuery = `
	schema{}
	`

	FuncUid        = `uid(%d)`
	FuncEq         = `eq(%s, %s)`
	FuncSimilarTo  = `similar_to(%s, %d, "[%s]")`
	FuncAllOfTerms = `allofterms(%s, "%s")`
	FuncAnyOfTerms = `anyofterms(%s, "%s")`
	FuncAllOfText  = `alloftext(%s, "%s")`
	FuncAnyOfText  = `anyoftext(%s, "%s")`
	FuncRegExp     = `regexp(%s, /%s/)`
	FuncLe         = `le(%s, %s)`
	FuncGe         = `ge(%s, %s)`
	FuncGt         = `gt(%s, %s)`
	FuncLt         = `lt(%s, %s)`
)

Variables

This section is empty.

Functions

func FormatObjQuery

func FormatObjQuery(qf QueryFunc, extraFields string) string

func FormatObjsQuery

func FormatObjsQuery(typeName string, qf QueryFunc, paginationAndSorting string, extraFields string) string

Types

type QueryFunc

type QueryFunc func() string

func And

func And(qfs ...QueryFunc) QueryFunc

func BuildAllOfTermsQuery

func BuildAllOfTermsQuery(attr string, terms string) QueryFunc

func BuildAllOfTextQuery

func BuildAllOfTextQuery(attr, text string) QueryFunc

func BuildAnyOfTermsQuery

func BuildAnyOfTermsQuery(attr string, terms string) QueryFunc

func BuildAnyOfTextQuery

func BuildAnyOfTextQuery(attr, text string) QueryFunc

func BuildEqQuery

func BuildEqQuery(key string, value any) QueryFunc

func BuildGeQuery

func BuildGeQuery(attr, value string) QueryFunc

func BuildGtQuery

func BuildGtQuery(attr, value string) QueryFunc

func BuildLeQuery

func BuildLeQuery(attr, value string) QueryFunc

func BuildLtQuery

func BuildLtQuery(attr, value string) QueryFunc

func BuildRegExpQuery

func BuildRegExpQuery(attr, pattern string) QueryFunc

func BuildSimilarToQuery

func BuildSimilarToQuery(indexAttr string, topK int64, vec []float32) QueryFunc

func BuildUidQuery

func BuildUidQuery(gid uint64) QueryFunc

func Not

func Not(qf QueryFunc) QueryFunc

func Or

func Or(qfs ...QueryFunc) QueryFunc

type SchemaField

type SchemaField struct {
	Name string `json:"name"`
}

type SchemaResponse

type SchemaResponse struct {
	Types []SchemaType `json:"types,omitempty"`
}

type SchemaType

type SchemaType struct {
	Name   string        `json:"name,omitempty"`
	Fields []SchemaField `json:"fields,omitempty"`
}

Jump to

Keyboard shortcuts

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