Hi all!
# spicedb
k
Hi all! Is it possible to import relationships from a file into SpiceDb? Is it possible to do this using zed cli?
v
👋 yes, you can pipe a file into
zed relationship create
or
zed relationship touch
. The tuple should be newline delimited, and have the form
resource_type:resource_id#resource_relation@subject_type:subject_id#subject_relation
k
what type of file should it be? .txt? Thanks!
v
extension does not matter, it's just a text file, newline delimited
l
You can do
zed import --insecure --schema=false --relationships=true authzed.yaml
With
authzed.yaml
being of this structure:
Copy code
yaml
schema: null
relationships: |
  platform:bace#administrator@user:sebastian
  order:test_order#consumer@user:sebastian

validation: null
15 Views