https://authzed.com logo
#spicedb
Title
# spicedb
j

Joey

12/30/2021, 9:35 PM
but in very rough pseudo-code (using Python as an example):
Copy code
with db_transaction() as transaction:
    # Write to the DB in the transaction
    ...

    # Write to SpiceDB
    try:
      resp = authzed_client.v1.WriteRelationships(....)
      # Store the zedtoken returned in `resp` on the resource being modified in the DB
    except:
       transaction.rollback()
    finally:
       transaction.commit()