[sqlite] How/Where to check if a table exists and read it ?

2016-10-04 Thread Domingo Alvarez Duarte
Hello ! I'm trying to make changes to sqlite to allow multi-databases databases (I mean have a database that is onl used to anchor attached databases and store mutli-database views/triggers). I already managed to add a new pragma "use_attached_databases=ON/OFF" to allow views/triggers to

Re: [sqlite] How/Where to check if a table exists and read it ?

2016-10-04 Thread Richard Hipp
On 10/4/16, Domingo Alvarez Duarte wrote: >> > The problem is I didn't found yet the point where I should intercept the > "openDatabase" where I plan to check if there is a table named for > example "use_attached_dbs" and then attach the databases on that table > and then

Re: [sqlite] Database malformed after 6000 Inserts?

2016-10-04 Thread Simon Slavin
On 4 Oct 2016, at 6:30pm, Roger Binns wrote: > On 04/10/16 03:11, Werner Kleiner wrote: >> ... after 6000 records. >> >> Is there a limitation with huge inserts? > > While there may be "Lite" in the name, SQLite copes very well with > "huge" stuff. > > That means many

Re: [sqlite] Pencils down for SQLite 3.15.0

2016-10-04 Thread R Smith
Draft documentation typo: This page: https://www.sqlite.org/draft/deterministic.html Under 1. Restrictions on the use of non-deterministic functions Last paragraph starts with: "In the cases above, the valued returned by the function is recorded in the index b-tree." I'm assuming this to be

Re: [sqlite] Database malformed after 6000 Inserts?

2016-10-04 Thread Roger Binns
On 04/10/16 03:11, Werner Kleiner wrote: > ... after 6000 records. > > Is there a limitation with huge inserts? While there may be "Lite" in the name, SQLite copes very well with "huge" stuff. That means many many gigabytes in database sizes, many many millions of rows, up to 2GB per row etc.

Re: [sqlite] How/Where to check if a table exists and read it ?

2016-10-04 Thread Domingo Alvarez Duarte
Hello Richard ! Thanks for reply ! I found the second point that was also controlling the restriction of referencing objects in other databases. Now it seems to work and I'll leave the initialization to the user level code for now, when the usage normalize I'll revisit it again to see if

[sqlite] Database malformed after 6000 Inserts?

2016-10-04 Thread Werner Kleiner
Hello, a program written in C# makes inserts from an SQL script into a sqlite db. We now saw that the database will be malformed after 6000 records. Is there a limitation with huge inserts? What could be the problem? regards Werner ___ sqlite-users

Re: [sqlite] smartest way to exchange a sqlite3 database with another empty

2016-10-04 Thread Luca Ferrari
On Mon, Oct 3, 2016 at 11:51 AM, Richard Hipp wrote: > Safe way: In a separate process, use the backup API > (https://www.sqlite.org/backup.html) to copy the content of the main > DB over to a separate DB, then "DELETE FROM log;" on the main DB. > This will work without any

Re: [sqlite] Mac OS Sierra deprecation in bindings

2016-10-04 Thread Judson Lester
I can't prevent it being output as a consumer of the Go library. I've needed to invest effort into my build chain to filter the warning; so there's been some amount of pointless labor as a consequence. It might be possible for the go-sqlite3 author to update the build commands to suppress it? All

Re: [sqlite] Database malformed after 6000 Inserts?

2016-10-04 Thread Rob Willett
We don't use Windows Server or System.Data.SQLite so can't comment. I'd be astonished if its Sqlite itself thats at fault here. Rob On 4 Oct 2016, at 13:24, Werner Kleiner wrote: Thanks for help. Hopefully I give you the correct answer, because a collegue has written the C# program. We had

Re: [sqlite] Database malformed after 6000 Inserts?

2016-10-04 Thread Werner Kleiner
Thanks for help. Hopefully I give you the correct answer, because a collegue has written the C# program. We had no problems with inserts in the past, but now if we have records about 6000 inserts we get the errors. The OS is Server 2012, there are no pragma settings (but collegue has also used

Re: [sqlite] Mac OS Sierra deprecation in bindings

2016-10-04 Thread Richard Hipp
On 10/4/16, Judson Lester wrote: > > That said, it's harmless until the deprecation turns into a removal at the > OS level, at which point ignoring the error becomes a sudden > incompatibility with SQLite bindings. > Engineers at Apple tell me that they are still using

Re: [sqlite] Database malformed after 6000 Inserts?

2016-10-04 Thread Simon Slavin
On 4 Oct 2016, at 1:24pm, Werner Kleiner wrote: > Hopefully I give you the correct answer, because a collegue has > written the C# program. > We had no problems with inserts in the past, but now if we have > records about 6000 inserts we get the errors. > > The OS is

Re: [sqlite] Database malformed after 6000 Inserts?

2016-10-04 Thread Jim Borden
I had a problem similar to this before. What is the threading model for access to the database and how is the native library compiled and configured? Jim Borden (Sent from a mobile device) > On 4 Oct 2016, at 19:12, Werner Kleiner wrote: > > Hello, > a program written

Re: [sqlite] Mac OS Sierra deprecation in bindings

2016-10-04 Thread Richard Hipp
On 10/4/16, Judson Lester wrote: > > Would you be so kind as to let me know when/if there's a SQLite ticket for > this so that I can link it back to the project I encountered this in? It's a harmless warning. *Harmless*. Can you not simply ignore it? -- D. Richard Hipp

Re: [sqlite] Database malformed after 6000 Inserts?

2016-10-04 Thread Rob Willett
We've done inserts of tens of thousand at a time, we may well have done hundreds of thousands in one single transaction. I've no doubt other people do even larger transactions. I would assume the problem lies elsewhere. What error message are you getting? Whats the OS, the environment, disk,

[sqlite] Two problems in latest version of lempar.c

2016-10-04 Thread Benjamin Franksen
Hello I am using the lemon parser generator in a project (http://www-csr.bessy.de/control/SoftDist/sequencer/). I updated the lemon parser template tools/lempar.c to the latest available version and found two problems, reported by gcc: ./snl.c: In function ‘yy_destructor’: ./snl.c:116:36:

Re: [sqlite] Mac OS Sierra deprecation in bindings

2016-10-04 Thread Judson Lester
Thanks very much. The warning itself recommends atomic_compare_exchange_strong(), but I can't tell you much more than that. Would you be so kind as to let me know when/if there's a SQLite ticket for this so that I can link it back to the project I encountered this in? It'll help in terms of that

Re: [sqlite] Two problems in latest version of lempar.c

2016-10-04 Thread Richard Hipp
On 10/4/16, Benjamin Franksen wrote: > Hello > > I am using the lemon parser generator in a project > (http://www-csr.bessy.de/control/SoftDist/sequencer/). I updated the > lemon parser template tools/lempar.c to the latest available version and > found two

[sqlite] Fastest way to backup a "live" database

2016-10-04 Thread Eric Grange
Hi, Given a fairly large database (dozens of gigabytes), which uses WAL, and is being accessed continuously (mostly read transactions, but regular write transactions as well), what are the fastest and less disruptive ways to back it up? A basic ".backup" from the CLI can occasionnally take

Re: [sqlite] Fastest way to backup a "live" database

2016-10-04 Thread Clemens Ladisch
Eric Grange wrote: > Given a fairly large database (dozens of gigabytes), which uses WAL, and is > being accessed continuously (mostly read transactions, but regular write > transactions as well), what are the fastest and less disruptive ways to > back it up? Use the backup API, and copy

Re: [sqlite] Fastest way to backup a "live" database

2016-10-04 Thread Domingo Alvarez Duarte
Hello Eric ! Have you looked at the ext/session extension ? It seems that it can be the answer for your problem. The basic idea is you'll create a function that will receive the changes made to the database and then you can incrementally apply then on the backup database. This way the

Re: [sqlite] Fastest way to backup a "live" database

2016-10-04 Thread Simon Slavin
On 4 Oct 2016, at 2:53pm, Eric Grange wrote: > I am going on the assumption that if something fails during backup, the > backup itself will be toast anyway, but is that safe otherwise? No. You have no locking. You might copy the beginning of the file before a transaction

Re: [sqlite] Fastest way to backup a "live" database

2016-10-04 Thread Simon Slavin
On 4 Oct 2016, at 3:05pm, Simon Slavin wrote: > No. You have no locking. You might copy the beginning of the file before a > transaction and the end of the file after it, meaning that pointers at one > part of the file point to things which no longer exist. I'm sorry.

Re: [sqlite] Mac OS Sierra deprecation in bindings

2016-10-04 Thread Richard Hipp
On 10/4/16, Judson Lester wrote: > Thanks for the info. Do you mind if I copy some of this information back to > the go-sqlite3 issues? I do not mind. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list

Re: [sqlite] Partial indexes on JSON properties?

2016-10-04 Thread Richard Hipp
On 10/4/16, Keith Medcalf wrote: > This raises another question. Is there any way to mark a function > in-between volatile and deterministic? Currently if the deterministic flag > is not set the optimizer assumes that the function is truly volatile (it is > called every

Re: [sqlite] Partial indexes on JSON properties?

2016-10-04 Thread Keith Medcalf
On Monday, 3 October, 2016 12:30, Richard Hipp wrote: > On 10/1/16, Jens Alfke wrote: > > the WHERE clause in a CREATE INDEX statement > > explicitly disallows function calls Is this limitation something > > that might be lifted soon > Deterministic SQL functions are

Re: [sqlite] Fastest way to backup a "live" database

2016-10-04 Thread Simon Slavin
On 4 Oct 2016, at 3:58pm, Eric Grange wrote: > If all else fail, I could also suspend DB writes during backups If it's easy to do that, then I'd recommend it. Used in conjunction with the SQLite backup API it should provide the simplest solution least likely to present a

Re: [sqlite] Fastest way to backup a "live" database

2016-10-04 Thread Eric Grange
> Have you looked at the ext/session extension ? Yes, but it is a bit more complicated to integrate, and would impose a penalty during execution as far as I understand: there are quite a few intermediate states that would be stored by a changeset, but that do not really need to be preserved at

Re: [sqlite] Fastest way to backup a "live" database

2016-10-04 Thread Clemens Ladisch
Eric Grange wrote: > If all else fail, I could also suspend DB writes during backups (suspending > DB reads would be more problematic). With WAL, the backup reader does not block writers. >> Use the backup API, and copy everything in one step. >> (The restart-on-write feature should not be

[sqlite] Pencils down for SQLite 3.15.0

2016-10-04 Thread Richard Hipp
Our intent is bug-fix changes only on trunk from now until the 3.15.0 release. Please test the beta available in the "Prerelease Snapshot" section of the download page: https://www.sqlite.org/download.html Release notes: https://www.sqlite.org/draft/releaselog/current.html Release check-list: