Re: [sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-13 Thread dan
Thanks Richard, in the end I added the quotes using some SED and AWK as I'm using SQLite as part of a BASH script. Thanks On 2017-06-13 14:36, Richard Hipp wrote: SQLite does not provide that capability, that I recall. But surely it would not be too difficult for you to do your own custom

[sqlite] INTEGER PRIMARY KEY AUTOINCREMENT

2017-06-13 Thread Wout Mertens
Is there a way to specify the starting rowid when using autoincrement? Or should I insert and then remove a row with the id set to one less than the desired id? ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] Daisy: A private blockchain where blocks are SQLite databases

2017-06-13 Thread Jens Alfke
That’s kind of weird, that each block payload is an entire SQLite database file. It means that the time to query the blockchain will grow linearly with the number of blocks (because you have to query every block), and you can’t run a query that might rely on data in two different blocks. To

[sqlite] Daisy: A private blockchain where blocks are SQLite databases

2017-06-13 Thread Richard Hipp
See https://github.com/ivoras/daisy I have no connection with Daisy and am not endorsing it. I just thought it was interesting and wanted to share it with the wider SQLite community. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list

Re: [sqlite] performance issue on a read only database

2017-06-13 Thread David Raymond
"Also please note that SQLite does a 'lazy open'. When you create your connection to the database file, SQLite doesn’t actually open the file. Instead the file handling is done the first time SQLite needs the data from the file. So the first SELECT after a new connection is made takes longer

Re: [sqlite] performance issue on a read only database

2017-06-13 Thread Simon Slavin
On 13 Jun 2017, at 10:53am, rv.gauth...@free.fr wrote: > Is there a way (pragma, compile flags, ...) to gain these 14 ms for the first > query ? In SQLite, it is transactions which take all the time. Individual commands such as SELECT are fast. What takes the time is the locking, journal

Re: [sqlite] performance issue on a read only database

2017-06-13 Thread Eduardo Morras
On Tue, 13 Jun 2017 11:53:05 +0200 rv.gauth...@free.fr wrote: > Hi all, > > we are using sqlite3 on an embedded application. > The database is opened in read only mode and can't be modified by the > application. > > I noticed that the first SELECT statement after a BEGIN TRANSACTION > takes

Re: [sqlite] performance issue on a read only database

2017-06-13 Thread Clemens Ladisch
rv.gauth...@free.fr wrote: > I noticed that the first SELECT statement after a BEGIN TRANSACTION takes at > least 14 ms. > All subsequent queries in the same transaction are taking near 0 ms. > > If I omit the BEGIN TRANSACTION, all queries are taking at least 14 ms. Because then you get an

Re: [sqlite] Feature request: support for FROM_UNIXTIME

2017-06-13 Thread Igor Tandetnik
On 6/13/2017 11:21 AM, René Cannaò wrote: I would like to have support for FROM_UNIXTIME() function, as available in MySQL: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_from-unixtime Some background about this feature request. ProxySQL

[sqlite] Feature request: support for FROM_UNIXTIME

2017-06-13 Thread René Cannaò
I would like to have support for FROM_UNIXTIME() function, as available in MySQL: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_from-unixtime Some background about this feature request. I perfectly understand that SQLite is not MySQL, that FROM_UNIXTIME is a

[sqlite] performance issue on a read only database

2017-06-13 Thread rv . gauthier
Hi all, we are using sqlite3 on an embedded application. The database is opened in read only mode and can't be modified by the application. I noticed that the first SELECT statement after a BEGIN TRANSACTION takes at least 14 ms. All subsequent queries in the same transaction are taking

Re: [sqlite] Is sqlite3_auto_extension() same compilation unit ruled out?

2017-06-13 Thread Keith Medcalf
There is a define called SQLITE_EXTRA_INIT. Make this the name of some code to run that does an sqlite3_auto_extension to add the extensions that you want to load in each connection. eg: Append the following to the SQLITE3.C file: /* ** This extension automatically sets the busy_timeout

Re: [sqlite] How-to and best practice for session extension

2017-06-13 Thread Simon Slavin
On 13 Jun 2017, at 11:24am, Robert M. Münch wrote: > We use SQLite's INVERT function on changesets, which does the trick. I > haven't looked at the code but assume that it applies the inverted actions in > reverse order. It does. Simon.

Re: [sqlite] How-to and best practice for session extension

2017-06-13 Thread Robert M. Münch
On 12 Jun 2017, at 17:33, Simon Slavin wrote: >> 1. Is it correct that schema changes are not tracked and can't be part of a >> changeset? So any ALTER TABLE command needs to be taken care about >> separately? > > Correct. Changing the schema means that changesets are no longer valid. You >

Re: [sqlite] Can I increase the performance of sqlite3_exec() or maybe change it to prepare+step?

2017-06-13 Thread Венцислав Русев
Thank you for your advice Simon and Keith. We strive to make the migration process faster, because our technicians are responsible of changing the program version of each embedded device and then migrating its database, not the end user. I'm creating the indexes last as you said, but

Re: [sqlite] Is sqlite3_auto_extension() same compilation unit ruled out?

2017-06-13 Thread petern
Thanks David. That works great for my immediate needs. Per below, shell.c doesn't even bother checking return code of sqlite3_create_function(). What could be simpler? --from shell.c-- static void open_db(ShellState *p, int keepAlive){ if(

[sqlite] Query on bug fix for ticket 7ffd1ca1d2ad4ec

2017-06-13 Thread Mohandas G Nayak
Hi All, We are using SQLite 3.7.16.1 in our product which has been released to market sometime back. We have been analysing releases of SQLite from 3.7.16 to 3.19.2 to see if we need to upgrade the SQLite for the software that is already deployed in the field. For this purpose we use release