SetType sets the type for the given predicate in memory. schema mutations must flow through the update function, which are synced to the db.
(typeName string, typ *pb.TypeUpdate)
| 234 | // SetType sets the type for the given predicate in memory. |
| 235 | // schema mutations must flow through the update function, which are synced to the db. |
| 236 | func (s *state) SetType(typeName string, typ *pb.TypeUpdate) { |
| 237 | s.Lock() |
| 238 | defer s.Unlock() |
| 239 | s.types[typeName] = typ |
| 240 | s.elog.Printf(logTypeUpdate(typ, typeName)) |
| 241 | } |
| 242 | |
| 243 | // Get gets the schema for the given predicate. |
| 244 | func (s *state) Get(ctx context.Context, pred string) (pb.SchemaUpdate, bool) { |
no test coverage detected