nested-hstore icon indicating copy to clipboard operation
nested-hstore copied to clipboard

Nested nils

Open mlitwiniuk opened this issue 10 years ago • 1 comments

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?

mlitwiniuk avatar Jul 21 '14 10:07 mlitwiniuk

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.

tombenner avatar Jul 21 '14 14:07 tombenner