Skip to content

Commit 9c5b192

Browse files
authored
Merge pull request #343 from authzed/composable-updates
reorganize composable schemas
2 parents 50cfc97 + 40101df commit 9c5b192

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

pages/spicedb/modeling/composable-schemas.mdx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ import { Callout, Tabs } from 'nextra/components'
66
This preview feature's functionality may change before general release.
77
</Callout>
88

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.0 introduced a new schema compilation command that allows you to modularize your schema.
1010

1111
```
12-
zed preview schema compile some-schema.zed
12+
zed preview schema compile root.zed
1313
```
1414

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:
1816

1917
<Tabs items={["root.zed", "subjects.zed"]}>
2018
<Tabs.Tab>
@@ -46,7 +44,7 @@ definition organization {}
4644
</Tabs.Tab>
4745
</Tabs>
4846

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:
5048

5149
```zed
5250
definition user {}
@@ -62,7 +60,7 @@ definition resource {
6260
}
6361
```
6462

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).
6664

6765
## Breaking Changes
6866

@@ -129,7 +127,6 @@ Any duplicate definitions will cause an error.
129127
## Partials
130128

131129
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.
133130

134131
### Partial Declarations
135132

@@ -206,10 +203,4 @@ Attempting to reference other declaration types (e.g. a definition or a caveat)
206203
Then on merge:
207204

208205
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

Comments
 (0)