MCPcopy Create free account
hub / github.com/Permify/permify / parseAndCompileSchema

Function parseAndCompileSchema

pkg/development/coverage/coverage.go:87–99  ·  view source on GitHub ↗

parseAndCompileSchema parses and compiles the schema into entity definitions

(schema string)

Source from the content-addressed store, hash-verified

85
86// parseAndCompileSchema parses and compiles the schema into entity definitions
87func parseAndCompileSchema(schema string) ([]*base.EntityDefinition, error) {
88 p, err := parser.NewParser(schema).Parse()
89 if err != nil {
90 return nil, err
91 }
92
93 definitions, _, err := compiler.NewCompiler(true, p).Compile()
94 if err != nil {
95 return nil, err
96 }
97
98 return definitions, nil
99}
100
101// extractSchemaReferences extracts all coverage references from entity definitions
102func extractSchemaReferences(definitions []*base.EntityDefinition) []SchemaCoverage {

Callers 1

RunFunction · 0.85

Calls 4

NewParserFunction · 0.92
NewCompilerFunction · 0.92
ParseMethod · 0.80
CompileMethod · 0.80

Tested by

no test coverage detected