MCPcopy
hub / github.com/dgraph-io/dgraph / TypeOf

Method TypeOf

schema/schema.go:275–282  ·  view source on GitHub ↗

TypeOf returns the schema type of predicate

(pred string)

Source from the content-addressed store, hash-verified

273
274// TypeOf returns the schema type of predicate
275func (s *state) TypeOf(pred string) (types.TypeID, error) {
276 s.RLock()
277 defer s.RUnlock()
278 if schema, ok := s.predicate[pred]; ok {
279 return types.TypeID(schema.ValueType), nil
280 }
281 return types.UndefinedID, errors.Errorf("Schema not defined for predicate: %v.", pred)
282}
283
284// IsIndexed returns whether the predicate is indexed or not
285func (s *state) IsIndexed(ctx context.Context, pred string) bool {

Callers 15

file_pb_proto_initFunction · 0.80
getSensitiveBytesMethod · 0.80
checkAndGetDropOpFunction · 0.80
sortWithoutIndexFunction · 0.80
sortWithIndexFunction · 0.80
intersectBucketFunction · 0.80
populateSchemaFunction · 0.80
runMethod · 0.80
convertValueFunction · 0.80
helpProcessTaskMethod · 0.80
handleRegexFunctionMethod · 0.80
handleCompareFunctionMethod · 0.80

Calls 4

TypeIDTypeAlias · 0.92
RLockMethod · 0.80
RUnlockMethod · 0.80
ErrorfMethod · 0.45

Tested by 1

TestSchemaFunction · 0.64