Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section on breaking schema changes #312

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pages/spicedb/modeling/composable-schemas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ definition resource {

This compilation step provides new features that help you modularize your schema, making organization and collaboration easier.

## Breaking Changes

The composable schema compiler has some breaking changes relative to the compiler used internally by SpiceDB on a `WriteSchema` call.
A new version of SpiceDB should not cause your schema to break.
However, the schema compiler introduces some new keywords (among other changes), which may result in a schema that can be
written to SpiceDB but not compiled.

The obvious breaking changes are `import` and `partial` becoming keywords, so if you have a permission or
relation with those names, your schema can't be compiled.
We have also reserved some keywords for future use, such as `and`, `or`, and `not`.
If you get an unexpected `TokenTypeKeyword` error, this is probably why.
A full list of reserved keywords can be found in [`keyword` map definition](https://github.com/authzed/spicedb/blob/main/pkg/composableschemadsl/lexer/lex_def.go#L74) in the lexer.

## Import Statements

Import statements allow you to break down a schema along the lines of top-level declarations.
Expand Down
Loading