ql icon indicating copy to clipboard operation
ql copied to clipboard

Do you have plans to add new types eg JSON?

Open DeadNumbers opened this issue 8 years ago • 7 comments
trafficstars

DeadNumbers avatar Jun 01 '17 08:06 DeadNumbers

In a sense, JSON is just a string/blob. What should adding type JSON provide?

cznic avatar Jun 01 '17 09:06 cznic

@cznic I mean equal Postgres json, where support query example select * from test where data @> '{"a":$1}';

DeadNumbers avatar Jun 01 '17 10:06 DeadNumbers

That looks like a lot of work. Suitable PRs will be accepted.

cznic avatar Jun 01 '17 12:06 cznic

What about leveraging v8 to help support JSON parsing?

awildeep avatar Sep 20 '18 17:09 awildeep

I believe a JSON parser is the easy and small part of this issue.

cznic avatar Sep 21 '18 09:09 cznic

If someone else can write the other necessary gears, which I have no idea about, I think I can prototype a JSON parser in maybe a day or so.

cznic avatar Sep 21 '18 09:09 cznic

correct me if I'm wrong but in postgres it's nice to have this on the query-language level because you reduce the amount of context switching between database and application layer (i.e. don't have to filter the results with application code). Is this also the case for embedded databases? Here it seems to be just a question of cleaner processing seperaration.

I only did a quick search but these to packages seem to do some of the lifting. So I think this + marshaling as a blob get's you quite far already without this having to be supported by the DB layer.

https://github.com/elgs/jsonql https://github.com/tidwall/gjson

cryptix avatar Sep 21 '18 10:09 cryptix