hi, guys. can u tell me how to compare
# spicedb
t
hi, guys. can u tell me how to compare two zedTokens? can I decode it on the client side into something like a timestamp or a datetime value?
v
ZedTokens should be treated as opaque tokens, the internal representation is subject to change at any time. And depending on your datastore, it's implemented in one way or another.
t
ok. can we decode (or compare) it for debug purposes? (we use postgres). we have two events (know their tokens) and want to know which happened earlier
v
postgres is precisely the snowflake. It uses internals to PG MVCC that cant be easily compared
I'm not even sure it can be done client side without reaching out to PG. @Jake ?
t
for debug it will be ok to make it on PG side
y
@teso what's the use case? what problem are you trying to solve by comparing tokens?
j
they can be compared locally, even postgres, they just aren't 100% orderable
that's not guaranteed to be true about all future zedtokens though, which is why they're opaque