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

Method Set

schema/schema.go:193–202  ·  view source on GitHub ↗

Set sets the schema for the given predicate in memory. Schema mutations must flow through the update function, which are synced to the db.

(pred string, schema *pb.SchemaUpdate)

Source from the content-addressed store, hash-verified

191// Set sets the schema for the given predicate in memory.
192// Schema mutations must flow through the update function, which are synced to the db.
193func (s *state) Set(pred string, schema *pb.SchemaUpdate) {
194 if schema == nil {
195 return
196 }
197
198 s.Lock()
199 defer s.Unlock()
200 s.predicate[pred] = schema
201 s.elog.Printf(logUpdate(schema, pred))
202}
203
204// SetMutSchema sets the mutation schema for the given predicate.
205func (s *state) SetMutSchema(pred string, schema *pb.SchemaUpdate) {

Callers

nothing calls this directly

Calls 3

logUpdateFunction · 0.85
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected