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

Function SchemaKey

x/keys.go:174–177  ·  view source on GitHub ↗

SchemaKey returns schema key for given attribute. Schema keys are stored separately with unique prefix, since we need to iterate over all schema keys. The structure of a schema key is as follows: byte 0: key type prefix (set to ByteSchema) byte 1-2: length of attr next len(attr) bytes: value of att

(attr string)

Source from the content-addressed store, hash-verified

172// byte 1-2: length of attr
173// next len(attr) bytes: value of attr
174func SchemaKey(attr string) []byte {
175 key, _ := generateKey(ByteSchema, attr, 0)
176 return key
177}
178
179// TypeKey returns type key for given type name. Type keys are stored separately
180// with a unique prefix, since we need to iterate over all type keys.

Callers 10

writeMethod · 0.92
updateSchemaFunction · 0.92
movePredicateHelperFunction · 0.92
RootNsSchemaKeyFunction · 0.92
DeleteMethod · 0.92
LoadFunction · 0.92
dropDepreciatedFunction · 0.92
fixPersistedQueryFunction · 0.92
FromBackupKeyFunction · 0.85
TestSchemaKeyFunction · 0.85

Calls 1

generateKeyFunction · 0.70

Tested by 1

TestSchemaKeyFunction · 0.68