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)
| 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. |
| 193 | func (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. |
| 205 | func (s *state) SetMutSchema(pred string, schema *pb.SchemaUpdate) { |