5 ms·
The type is inferred from when you initially set the value. Note that saving the string '1' will return the integer 1 due to the naive nature of the implementat
by zackmorris 11y ago
The type is inferred from when you initially set the value. Note that saving the string '1' will return the integer 1 due to the naive nature of the implementation. Hashes, arrays and booleans behave as expected when saved.
Can you elaborate upon this in the readme? It wasn't clear to me whether git, ruby or the gkv has the naive implementation (or if the conversion only happens with the string '1').
Also is it possible to enumerate the versions of key-values that have been saved?
I'm sure I have several more questions but I'll leave it at that. Thanks for making this!
- rhgraysonii 11y agoI just saw this now, sorry for being 5 days late if you even end up noticing it. The typing is governed by YAML standards. This is why symbols are left out. Since it uses `YAML.dump` and `YAML.load` with the set/get, it will automatically assume the string '1' is an integer, '1.0' a float, and so on. > is it possible to enumerate the versions of key-values that have been saved? Yes, using the `get_version` method, you could do something like: all_items = $ITEMS[key].map { |hash| db.get(hash) } I should add this as a normal function to the API. Its now on my todo list.
- rhgraysonii 11y agoJust added the all past versions feature to the API now.