Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Nested pulls don't get correct datatype #34
If I have a
I don't quite understand how you're doing the pull magic, but it seems like there's a final tree traversal that converts datatypes, or something like that, missing
Yeah it's interesting, I thought the extension to read json from postgres would handle this, but unfortunately, it does not.
Another option which I was kind of not wanting to do because I sort of already hacked up a solution using this is
Maybe I can figure out a way to extend the postgres driver to do this though.
I stared at your code in https://github.com/coast-framework/coast/blob/master/src/coast/db/query.clj for a while and now have a general idea on how you do things (related, it would be super helpful if you put some docstrings on the namespaces that explain the general ideas of what's happening).
So yeah, if you're building a JSON object, you will always just get text. Postgres has no idea what text represents a date or a datetime, and converting them just by pattern-matching could lead to some awkward false-positives. I can't think of a way that doesn't involve a tree-walk either..