Re: [sqlite] LiteCLI

2019-01-08 Thread Amjith Ramanujam
You can explicitly request an in memory database at the time of launch like this: litecli :memory: On Tue, Jan 8, 2019, 05:44 BohwaZ Looks great! > > I was expecting it to behave like the default sqlite CLI tool though, > that is if you fire it with no arguments it would automatically start >

Re: [sqlite] LiteCLI

2019-01-08 Thread BohwaZ
Looks great! I was expecting it to behave like the default sqlite CLI tool though, that is if you fire it with no arguments it would automatically start a temporary database (see https://www.sqlite.org/inmemorydb.html ), but it doesn't seem like it's possible? Cheers.

Re: [sqlite] SQLite 3.21.0 for z/OS UNIX - installation issues

2019-01-08 Thread Mario Bezzi
Thank you. As an old mainframe system programmer I am not very proficient at gawk. I lately met Python and I love it, but this is another story. The only reason I chose awk is that it is already available in any plain USS environment. If you don't mind I will incorporate your change in my sc

Re: [sqlite] [EXTERNAL] json_group_array() and sorting

2019-01-08 Thread Eric Grange
Shawn's json_group_array(json(o)) works indeed, but it's also 30% slower in my case than using '[' || ifnull(group_concat(o, ','), '') || ']' which is however more case specific and less obvious. Would be nice to see the subtype passing be improved, as otherwise query planner improvements could

Re: [sqlite] [EXTERNAL] json_group_array() and sorting

2019-01-08 Thread Dominique Devienne
On Tue, Jan 8, 2019 at 11:04 AM Dominique Devienne wrote: > > On Tue, Jan 8, 2019 at 10:50 AM Eric Grange wrote: >> >> Can someone confirm whether this is a bug ? > > > My guess is that it works as "designed", even if this is surprising... > > I believe that JSON1 leverages value "sub-types" [1],

Re: [sqlite] [EXTERNAL] json_group_array() and sorting

2019-01-08 Thread Shawn Wagner
Try using json_group_array(json(o)) On Tue, Jan 8, 2019, 1:50 AM Eric Grange Thanks. > > I think I may have encountered a "real" bug while ordering in a subquery. > I have simplified it in the following exemples: > > select json_group_array(o) from ( >select json_object( > 'id', sb.id >

Re: [sqlite] [EXTERNAL] json_group_array() and sorting

2019-01-08 Thread Dominique Devienne
On Tue, Jan 8, 2019 at 10:50 AM Eric Grange wrote: > Thanks. > > I think I may have encountered a "real" bug while ordering in a subquery. > I have simplified it in the following exemples: > > select json_group_array(o) from ( >select json_object( > 'id', sb.id >) o >from ( >

Re: [sqlite] [EXTERNAL] json_group_array() and sorting

2019-01-08 Thread Eric Grange
Thanks. I think I may have encountered a "real" bug while ordering in a subquery. I have simplified it in the following exemples: select json_group_array(o) from ( select json_object( 'id', sb.id ) o from ( select 1 id, 2 field ) sb ) the json_group_array returns an a

Re: [sqlite] [EXTERNAL] json_group_array() and sorting

2019-01-08 Thread Hick Gunter
I don't recall that any (aggregate) function is concerned at all about the order in which rows are visited. The effect is only visible in non-commutative aggregates (e.g. concatenation). If you want the arguments presented to an aggregate function in a specific order, then you need to enforce t

[sqlite] json_group_array() and sorting

2019-01-08 Thread Eric Grange
Hi, Is json_group_array() supposed to honor a sorting clause or not ? (and concatenation aggregates in general) I have a query like select json_group_array(json_object( 'id', st.id, 'num', st.numeric_field, ...bunch of fields here... )) from some_table st ...bunch of joins here... where