Re: [sqlite] New sqlite version update tool based on pragma

2016-10-03 Thread Sergei G
I can certainly add a transaction. I did not know "Android's SQLiteOpenHelper" exists. On Sat, Oct 1, 2016 at 1:01 AM, Clemens Ladisch wrote: > Sergei G wrote: > > I wrote a tool that I am using to maintain SQLite DB schema. It is very > > simple and it is based on user_version pragma, which m

Re: [sqlite] Partial indexes on JSON properties?

2016-10-03 Thread Jens Alfke
> On Oct 3, 2016, at 11:29 AM, Richard Hipp wrote: > > Deterministic SQL functions are now allowed in partial index WHERE > clauses, as of a few minutes ago. The current "Prerelease Snapshot" > (https://www.sqlite.org/download.html ) > supports this capabil

Re: [sqlite] Partial indexes on JSON properties?

2016-10-03 Thread Richard Hipp
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 now allowed in partial index WHERE clauses, as of a few minutes ago. The current "Prerele

Re: [sqlite] Default ordering of SELECT query

2016-10-03 Thread Simon Slavin
On 3 Oct 2016, at 3:18pm, Andrii Motsok wrote: > Can we assume that container1 == container2 ? Or in another words can we > assume that order of rows is same in this scenario? Even if this assumption holds true in the current version of SQLite, someone could always do PRAGMA reverse_unordere

Re: [sqlite] Default ordering of SELECT query

2016-10-03 Thread Clemens Ladisch
Andrii Motsok wrote: > "If a SELECT statement that returns more than one row does not have an ORDER > BY clause, the order in which the rows are returned is undefined" > > We have scenario: > * database is opened in WAL mode > * 10 rows have been read to container1 > * database has been checkpo

[sqlite] Default ordering of SELECT query

2016-10-03 Thread Andrii Motsok
Hi, Sqlite man (https://www.sqlite.org/lang_select.html) [https://sqlite.org/images/syntax/select-stmt.gif] SQLite Query Language: SELECT www.sqlite.org The SELECT statement is used to query the database. The resu

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

2016-10-03 Thread Domingo Alvarez Duarte
Hello Richard ! Ok I missed this point, but still while fighting to use sqlite3 with big databases I was thinking on some custom changes to allow sqlite relax some restrictions: 1- Create a new sqlite reserved table for register attached databases, this way every time a program try to open an

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

2016-10-03 Thread Richard Hipp
On 10/3/16, Domingo Alvarez Duarte wrote: > Hello ! > > Thinking about this and the problem I'm experiencing with big databases > with sqlite3 "vacuum" probably could be a good idea to use a flag in the > sqlite3 header to inform other processes to reopen the database. > That might work on unix.

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

2016-10-03 Thread Domingo Alvarez Duarte
Hello ! Thinking about this and the problem I'm experiencing with big databases with sqlite3 "vacuum" probably could be a good idea to use a flag in the sqlite3 header to inform other processes to reopen the database. Right now every time sqlite3 would perform an operation on a database it a

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

2016-10-03 Thread Paul Sanderson
It seems that you just want to keep access to all of your historic logging so rather than copy/backup the entire database you could just create a new archive DB (or open an old one), attach it, copy x records to the archive and then delete the same x records from the master. How big is your log da

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

2016-10-03 Thread Stephen Chrzanowski
Are you looking to keep the logs in the same file, or, are you looking to put your log entries in a new file? If you're interested in just keeping a single file, and if you've got access to change your code that is writing to the database, then, what I would do is "create table if not exists Logs

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

2016-10-03 Thread Florian Weimer
* Richard Hipp: > You cannot rename a database file while another process has that > database open. Windows simply will not allow that. If you do it on > Unix, then the process that has the file open will not know that the > file has been renamed and will continue to write to the original file.

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

2016-10-03 Thread Petite Abeille
> On Oct 3, 2016, at 11:18 AM, Luca Ferrari wrote: > > What is the right way to do it without having to stop the application > (and therefore without knowing when a new I/O operation will be > issued)? You could use the attach/detach [1] functionality to transparently roll the logs over. Some

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

2016-10-03 Thread Richard Hipp
On 10/3/16, Luca Ferrari wrote: > Hi all, > in one of my application I use a sqlite3 database as a log of > activity. As you can imagine the file grows as time goes by, so I'm > figuring I've to substitute it with an empty one once a good size is > reached. > What is the right way to do it without

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

2016-10-03 Thread Niall O'Reilly
On 3 Oct 2016, at 10:18, Luca Ferrari wrote: > in one of my application I use a sqlite3 database as a log of > activity. As you can imagine the file grows as time goes by, so I'm > figuring I've to substitute it with an empty one once a good size is > reached. > What is the right way to do it with

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

2016-10-03 Thread Luca Ferrari
Hi all, in one of my application I use a sqlite3 database as a log of activity. As you can imagine the file grows as time goes by, so I'm figuring I've to substitute it with an empty one once a good size is reached. What is the right way to do it without having to stop the application (and therefor