ParseBytes parses the byte array which holds the schema. We will reset all the globals. Overwrites schema blindly - called only during initilization in testing
(s []byte, gid uint32)
| 24 | // all the globals. |
| 25 | // Overwrites schema blindly - called only during initilization in testing |
| 26 | func ParseBytes(s []byte, gid uint32) (rerr error) { |
| 27 | if pstate == nil { |
| 28 | reset() |
| 29 | } |
| 30 | pstate.DeleteAll() |
| 31 | result, err := Parse(string(s)) |
| 32 | if err != nil { |
| 33 | return err |
| 34 | } |
| 35 | |
| 36 | for _, update := range result.Preds { |
| 37 | State().Set(update.Predicate, update) |
| 38 | } |
| 39 | return nil |
| 40 | } |
| 41 | |
| 42 | func parseDirective(it *lex.ItemIterator, schema *pb.SchemaUpdate, t types.TypeID) error { |
| 43 | it.Next() |