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
Sometimes SQL (yes even SQLite) has too much overhead or added complexity, especially if you want to just save/persist structures
to storage and the most common relationship you have is one of "ownership". An alternative option is to use a key value DB,
but most of the time this is done by "pickling/encoding" the structure using some language native facility to store the structure,
and so you lose the ability to extract individual field entries if you want to.
When a structure is "saved", each struct field and it's value become a new entry. The library uses this key structure internally
"TABLE_NAME.COLUMN_NAME.OWNERUUID.ROWID" to store each of the struct's fields. The code in the example for example (hmm) results in:
being stored. Using the power of key prefix iteration, you can then extract all structures which have a specific owner,
which the library does internally by using a prefix key which is the full key except for the row number element which is
a wildcard.
License
About
Go library to make it easy to persist full structs into a key value store database