but in very rough pseudo-code (using Python as an ...
# spicedb
j
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()
3 Views