You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This preview feature's functionality may change before general release.
7
7
</Callout>
8
8
9
-
In zed version v0.27.0, we introduced a schema compilation command:
9
+
To make it easier to organize your schema and collaborate across teams, `zed` version v0.27.0introduced a new schema compilation command that allows you to modularize your schema.
10
10
11
11
```
12
-
zed preview schema compile some-schema.zed
12
+
zed preview schema compile root.zed
13
13
```
14
14
15
-
There are three new pieces of syntax: [import statements](#import-statements), [partial declarations](#partial-declarations), and [partial references](#partial-references).
16
-
17
-
This is a simple schema that demonstrates all three features:
15
+
The command allows you to combine a schema that is spread across many files, for example:
18
16
19
17
<Tabsitems={["root.zed", "subjects.zed"]}>
20
18
<Tabs.Tab>
@@ -46,7 +44,7 @@ definition organization {}
46
44
</Tabs.Tab>
47
45
</Tabs>
48
46
49
-
Compiling the above with `zed preview schema compile root.zed` will produce an output schema that looks like:
47
+
And it produces an output schema that can be understood by SpiceDB's `WriteSchema` API:
50
48
51
49
```zed
52
50
definition user {}
@@ -62,7 +60,7 @@ definition resource {
62
60
}
63
61
```
64
62
65
-
This compilation step provides new features that help you modularize your schema, making organization and collaboration easier.
63
+
There are three new pieces of syntax: [import statements](#import-statements), [partial declarations](#partial-declarations), and [partial references](#partial-references).
66
64
67
65
## Breaking Changes
68
66
@@ -129,7 +127,6 @@ Any duplicate definitions will cause an error.
129
127
## Partials
130
128
131
129
Partial declarations and references provide a means of decomposing a schema along lines that cross definition boundaries.
132
-
This can be useful for separating out a schema by team or domain concern, for example.
133
130
134
131
### Partial Declarations
135
132
@@ -206,10 +203,4 @@ Attempting to reference other declaration types (e.g. a definition or a caveat)
206
203
Then on merge:
207
204
208
205
1. CI runs `zed preview schema compile`
209
-
1. CI calls SpiceDB with the compiled schema
210
-
211
-
## Notes
212
-
213
-
SpiceDB `WriteSchema` calls cannot interpret `import` or `partial` syntax.
214
-
If using the new syntax, you must build the schema using `compile` before it can be submitted.
215
-
This is because a schema write must happen in a single call to SpiceDB.
206
+
1. CI calls SpiceDB's WriteSchema API with the compiled schema
0 commit comments