rotten / rethinkdb-multicorn-postgresql-fdw

Multicorn based PostgreSQL Foreign Data Wrapper for RethinkDB
MIT License
20 stars 5 forks source link

now also converting lists to JSON #6

Closed postsql closed 7 years ago

postsql commented 8 years ago

Hi, this now also converts arrays to JSON in addition to dicts

before this arrays - especially text arrays - are passed as ugly python arrays which do not parse aa JSON type

they looks omething like this : "[u'hjkfhkj', ..."

ghost commented 7 years ago

@postsql what about if isinstance(resultRow[resultColumn], (dict, list)): ?

rotten commented 7 years ago

I can't believe I didn't notice this pull request sooner(!) It has been a really busy summer. Sorry about that. @olshevskiy87 's approach is certainly more compact. I'm not sure it makes all that much of a difference, and I'm ok with the first approach for now, so I'll just merge it in. If someone wants to send another pull request with the more elegant/compact if statement instead, I don't mind merging that in, instead.