nested-hstore
nested-hstore copied to clipboard
Nested nils
Before submitting PR I would like to know your opinion. Basically hstore does not support nils - it returns empty strings instead. But while using your gem nils are present in nested hashes. In my opinion this should be unified in one way or another. What do you think?
It'd be great to support nils at the hstore level. One approach might be to store a value like '___NULL___'
for nils (there's a small chance that users may be using 'NULL'
strings and I wouldn't want to interfere with that). The key shouldn't be modified, as that would affect users' queries, and I'd rather not add a type-defining second key (e.g. { 'my_key' => '', 'my_key_TYPE' => 'NULL' }
), as that could potentially increase the size of some users' hstores significantly. What do you think would be the best solution?
Ideally numeric values would be preserved, too, but a solution for that isn't as clear.