Hello !  

Looking at the documentation of json* functions and after see the example
given for a query on a field mixed owith string and json_array:  

_______  SELECT name FROM user WHERE phone LIKE '704-%'  UNION  SELECT
user.name    FROM user, json_each(user.phone)   WHERE json_valid(user.phone) 
   AND json_each.value LIKE '704-%';  

_______  

That sparked a question that also relates with the new "index over
expressions" given the example above would be a natural need to index on json
arrays.  

________pseudo sql  

CREATE TABLE user(name, phones);  

CREATE INDEX user_phones ON user(json_array_each_one(phones));  

INSERT INTO user VALUES('Paul', '["12345678","87654324", "5302513"]');  

SELECT * FROM USER WHERE json_array_each_one(phones) = '87654321';  

_______  

On the pseudo example above I was expecting the creation of an index with
zero or more entries for each record to allow quick searches.  

Cheers !  

?  
>  Fri Sep 11 2015 5:58:36 pm CEST CEST from "Richard Hipp" <drh at sqlite.org> 
>Subject: [sqlite] Feedback request: JSON support in SQLite
>
>  Draft documentation for the current design of JSON support in SQLite
> can be seen on-line at
> 
> https://www.sqlite.org/draft/json1.html
> 
> Your feedback is encouraged.
> 
> All features described in the document above are implemented and
> working in the latest trunk version of SQLite, which you can download
> in source-code form from https://www.sqlite.org/src/timeline?y=ci and
> compile yourself using instructions found at
> https://www.sqlite.org/src/doc/trunk/README.md
> 
> -- 
> D. Richard Hipp
> drh at sqlite.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> 
>
>  



?

Reply via email to