Re: [sqlite] THREADSAFE (1, SERIALIZED) vs (2, MULTITHREAD)

2019-08-05 Thread Adrian Ho
On 6/8/19 8:55 AM, Keith Medcalf wrote: > The THREADSAFE parameter merely sets the level of suspenders that you > wish to have to protect against shoddy programming or > non-deterministic languages (ie, those that do things such as > asynchronous garbage collection or destructors). Or one of the

Re: [sqlite] THREADSAFE (1, SERIALIZED) vs (2, MULTITHREAD)

2019-08-05 Thread Keith Medcalf
On Monday, 5 August, 2019 17:23, test user wrote: >Whats the difference between these two options for the >SQLITE_THREADSAFE compile time flag? >From the docs: >(1, SERIALIZED) >(2, MULTITHREAD) The SQLite3 library code is not multiply re-entrant, but is only singly-entrant on each

[sqlite] THREADSAFE (1, SERIALIZED) vs (2, MULTITHREAD)

2019-08-05 Thread test user
Hello, Whats the difference between these two options for the SQLITE_THREADSAFE compile time flag? From the docs: (1, SERIALIZED) - Safe for use in a multithreaded environment - Enables all mutexes including the recursive mutexes on database connection and prepared statement objects.

Re: [sqlite] Avoiding resource exhaustion caused by executing untrusted SQL queries

2019-08-05 Thread Richard Hipp
On 8/5/19, Simon Willison wrote: > > My concern is more queries that might use an enormous quantity of RAM or > starve the CPU. > > I'm using the Python standard library sqlite3 module, (1) You could monitor SQLite memory usage in your progress callback and interrupt the running query if the

[sqlite] Avoiding resource exhaustion caused by executing untrusted SQL queries

2019-08-05 Thread Simon Willison
I'm working on a Python web application project (Datasette) where I'd like to accept untrusted SQL queries from users and execute them against a SQLite database, without risk of malicious SQL being used to perform a denial of service attack against my application. I'm opening the database file

Re: [sqlite] Doc about sqlite_master

2019-08-05 Thread Dominique Devienne
On Mon, Aug 5, 2019 at 2:03 PM Simon Slavin wrote: > On 5 Aug 2019, at 11:54am, Dominique Devienne wrote: > > > What other sqlite_* tables are you talking about? > > sqlite_master is AFAIK the only table with a "fixed-name", that's part > of the "public API" as previously discussed. > > I would

Re: [sqlite] Doc about sqlite_master

2019-08-05 Thread Simon Slavin
On 5 Aug 2019, at 11:54am, Dominique Devienne wrote: > What other sqlite_* tables are you talking about? > > sqlite_master is AFAIK the only table with a "fixed-name", that's part of the > "public API" as previously discussed. I would argue that sqlite_sequence and sqlite_stat?, as documented

Re: [sqlite] Doc about sqlite_master

2019-08-05 Thread Dominique Devienne
On Mon, Aug 5, 2019 at 11:37 AM Simon Slavin wrote: > On 5 Aug 2019, at 10:34am, Dominique Devienne wrote: > > > Thus my suggestion that an explicit page of its own is > warranted, properly indexed then. > Given that there are other sqlite_* tables which are documented, perhaps > rather than

Re: [sqlite] Hidden data

2019-08-05 Thread J Decker
On Sun, Aug 4, 2019 at 9:40 AM Simon Slavin wrote: > On 4 Aug 2019, at 5:33pm, bitwyse wrote: > > > Could it be hidden in a Blob? > > What program (command?) would diplay it and allow deleting it? > > (VACUUMing doesn't remove it.) > > There's only one program guaranteed to get at every element

Re: [sqlite] Doc about sqlite_master

2019-08-05 Thread Simon Slavin
On 5 Aug 2019, at 10:34am, Dominique Devienne wrote: > Thus my > suggestion that an explicit page of its own is warranted, > properly indexed then. Given that there are other sqlite_* tables which are documented, perhaps rather than having a page on just sqlite_master, there should be a page

Re: [sqlite] Doc about sqlite_master

2019-08-05 Thread Dominique Devienne
On Mon, Aug 5, 2019 at 10:37 AM Simon Slavin wrote: > On 5 Aug 2019, at 9:25am, Dominique Devienne wrote: > < > https://www.sqlite.org/fileformat2.html#storage_of_the_sql_database_schema > > > > I think the first of those could be said to be the place to go for

Re: [sqlite] mode insert dumps

2019-08-05 Thread Luca Ferrari
On Fri, Aug 2, 2019 at 12:03 PM Olivier Mascia wrote: > Besides the other answers focused on using .mode insert more precisely, the > .dump command might prove useful too. Yes, but dump will dump all the columns, including autoincrement, that is something I want to avoid in the final output.

Re: [sqlite] mode insert dumps

2019-08-05 Thread Luca Ferrari
On Fri, Aug 2, 2019 at 10:17 AM Dan Kennedy wrote: >sqlite3> .headers on Yes, but I forgot to mention that I'm using sqlite 3.7.17 (back from 2013), so this option is not working. However, since I've tested it works on recent versions, I think I would copy all the databases on a machine with

[sqlite] Information Schema enhancement request

2019-08-05 Thread Dominique Devienne
(Not sure it's strictly information schema related, but here goes anyway). SQLite has grown in the recent months better support for extracting an information schema, thanks to new pragmas and especially their eponymous vtable versions, allowing them to be mixed in queries with sqlite_master. But

Re: [sqlite] Doc about sqlite_master

2019-08-05 Thread Simon Slavin
On 5 Aug 2019, at 9:25am, Dominique Devienne wrote: > First, is sqlite_master part of the "public API" of SQLite? > I would think so, since many example refer to it. It's documented. Therefore it can't be changed on a whim. So I'd agree that it's part of the public API. The two most

[sqlite] Doc about sqlite_master

2019-08-05 Thread Dominique Devienne
First, is sqlite_master part of the "public API" of SQLite? I would think so, since many example refer to it. I was thus looking for a Doc page about it, but a quick Google search didn't turn up a "direct" result. For example, the values sqlite_master.type can take, I found only outside

Re: [sqlite] Hidden data

2019-08-05 Thread bitwyse
Thank you, Adrian, that's really helpful. Regards Christophe -- bitwyse [PGP KeyID 0x18EB38C4] Les conseils - c'est ce qu'on demande quand on connaît déjà la réponse mais aurait préféré ne pas la savoir. ___ sqlite-users mailing list