Re: [sqlite] json question

2018-03-27 Thread Keith Medcalf
Became part of the SQL standard in 1999. Available in SQLite3 since 2014-02-03 (3.8.3). https://www.sqlite.org/lang_with.html --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users

Re: [sqlite] json question

2018-03-27 Thread Ian Zimmerman
On 2018-03-27 19:26, Keith Medcalf wrote: > Actually, it is very simple and straightforward to implement > hierarchical structures using Relational Database Models. But not recursive structures (or to be more precise, recursive queries) which are the next very natural step. You can have a

Re: [sqlite] json question

2018-03-27 Thread Warren Young
On Mar 27, 2018, at 7:26 PM, Keith Medcalf wrote: > >> The point of JSON support in SQLite, IMHO, is that it allows for >> hierarchical data structures, not something that is easy to do in a >> relational table-based DBMS like SQLite otherwise. > > Actually, it is very

Re: [sqlite] json question

2018-03-27 Thread Keith Medcalf
>The point of JSON support in SQLite, IMHO, is that it allows for >hierarchical data structures, not something that is easy to do in a >relational table-based DBMS like SQLite otherwise. Actually, it is very simple and straightforward to implement hierarchical structures using Relational

Re: [sqlite] json question

2018-03-27 Thread Warren Young
On Mar 27, 2018, at 12:46 AM, rene wrote: > > "arrayname" : [ > { >"name" : "unique_name", >"id" : 1, >... > }, > .. > ] That looks like CREATE TABLE arrayname ( Id INTEGER NOT NULL PRIMARY KEY, name TEXT NOT NULL, etc INTEGER... );

Re: [sqlite] SQLITE_CONFIG_MULTITHREAD needed for connection pool?

2018-03-27 Thread Jens Alfke
> On Mar 27, 2018, at 2:37 PM, Olivier Mascia wrote: > > Been there, changed plans. In our case we profiled no net benefit from such > a pooling compared to have each thread which need a connection to actually > open it, use it and then close it. It looks like you really

Re: [sqlite] SQLITE_CONFIG_MULTITHREAD needed for connection pool?

2018-03-27 Thread Olivier Mascia
> Le 27 mars 2018 à 22:55, Deon Brewis a écrit : > > The model we use for SQLITE is to use a connection pool (connections opened > via sqlite3_open_v2). > > We have many threads, but only one thread can use a connection at a time - a > thread takes it out of the pool, and

Re: [sqlite] SQLITE_CONFIG_MULTITHREAD needed for connection pool?

2018-03-27 Thread Keith Medcalf
You never *need* to change SQLITE_CONFIG_MULTITHREAD. The default mode is "serialized", which means that if you "accidentally" violate the serial entrance requirements of a connection (by accessing it simultaneously on multiple threads) that all hell will not break loose. This is achieved by

[sqlite] SQLITE_CONFIG_MULTITHREAD needed for connection pool?

2018-03-27 Thread Deon Brewis
The model we use for SQLITE is to use a connection pool (connections opened via sqlite3_open_v2). We have many threads, but only one thread can use a connection at a time - a thread takes it out of the pool, and when done, returns it to the pool. The only exception to this is calls to:

[sqlite] ext/icu/README.txt - typo?

2018-03-27 Thread Olivier Mascia
I'm reading ext/icu/README.txt and paragraph 1.1 SQL Scalars upper() and lower() says: > To utilise "general" case mapping, the upper() or lower() scalar > functions are invoked with one argument: > > upper('ABC') -> 'abc' > lower('abc') -> 'ABC' Isn't this sample

[sqlite] Yet another beta-test success!

2018-03-27 Thread Richard Hipp
A beta-tester has found another bug in the reason query optimizer enhancements! One of the changes in version 3.23.0 is that the push-down optimization [1] was made more aggressive. In other words, the conditions on which the push-down optimization depended were relaxed somewhat so that it

Re: [sqlite] json question

2018-03-27 Thread Jens Alfke
> On Mar 26, 2018, at 11:46 PM, rene wrote: > > Question 1: Is it possible to create an index on "name" and "id" inside > sqlite Not really, because SQLite indexes only support values with a 1::1 relationship to table rows; in other words, the index can have only one entry

[sqlite] json question

2018-03-27 Thread rene
Hello, I have a big json string in an sqlite memory database. The json string contains also arrays like: "arrayname" : [ { "name" : "unique_name", "id" : 1, ... }, .. ] Currently I create my own index on "name" and "id" and get the values with: