You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if u64 values could be persisted somehow, even if the representation would not allow for correct database operations.
Some possible representations come to mind:
store as i64, and re-interpret the bits as u64
pro: efficient
con: breaks sorting when we get a sign overflow
store as decimal string
pro: human-readable, preserves sort order, in-database arithmetic possible (probably not correct when sign overflows)
con: somewhat less efficient
store as big-endian 8-byte BLOB
pro: reasonably efficient, sorted in memcmp() order
con: on in-database arithmetic, BLOBs aren't interpreted as binary but as a numeric string, so this would totally not work except for persistence
Cheers,
Hans-Martin
(Since this is my first comment on Turbosql, I must add this: This is a really cool approach to lightweight persistence, it hits the sweet spot for the photo management app that I'm currently building, a breeze to work with! Thanks a lot!)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It would be nice if u64 values could be persisted somehow, even if the representation would not allow for correct database operations.
Some possible representations come to mind:
Cheers,
Hans-Martin
(Since this is my first comment on Turbosql, I must add this: This is a really cool approach to lightweight persistence, it hits the sweet spot for the photo management app that I'm currently building, a breeze to work with! Thanks a lot!)
Beta Was this translation helpful? Give feedback.
All reactions