Re: [sqlite] Client/Server Best Practices

2015-01-02 Thread Keith Medcalf
On Friday, 2 January, 2015 16:26, James K. Lowden said: >On Thu, 25 Dec 2014 05:32:45 -0700 (MST) Rick Kelly wrote: >> All SELECT type requests are wrapped with BEGIN TRANSACTION/COMMIT >That shouldn't be necessary and afaik isn't necessary.

Re: [sqlite] Client/Server Best Practices

2015-01-02 Thread J Decker
On Fri, Jan 2, 2015 at 3:25 PM, James K. Lowden wrote: > On Thu, 25 Dec 2014 05:32:45 -0700 (MST) > Rick Kelly wrote: > > > All SELECT type requests are wrapped with BEGIN TRANSACTION/COMMIT > > That shouldn't be necessary and afaik isn't necessary.

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Igor Tandetnik
On 1/2/2015 4:54 PM, J Decker wrote: select * from messages where received < datetime( 'now', '-3600' ) datetime( 'now', '-3600' ) returns NULL; the second parameter is not a valid modifier string. Most comparisons with NULL values report false. -- Igor Tandetnik

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread James K. Lowden
On Fri, 2 Jan 2015 16:12:23 -0800 J Decker wrote: > I understand it's kept as a string... It might be more helpful to think of it not in terms of how it's "kept" but as what its type is. How it's kept is up to the DBMS to decide. But the column is of a type: one of text,

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread J Decker
On Fri, Jan 2, 2015 at 4:44 PM, Simon Slavin wrote: > > On 3 Jan 2015, at 12:12am, J Decker wrote: > > > https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct > type > > */ > > No it doesn't. It says that if you try to define a column as

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Keith Medcalf
The datetime() function takes an argument which represents a date and time string. The magic string 'now' equates to the computers concept of the current GMT time. This string, unless an additional modification is applied via the 'localtime' modifier, is always returned as a timestring in

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Simon Slavin
On 3 Jan 2015, at 12:12am, J Decker wrote: > https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct type > */ No it doesn't. It says that if you try to define a column as DATETIME SQLite will understand it as you wanting a column with NUMERIC affinity. >

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread J Decker
On Fri, Jan 2, 2015 at 4:29 PM, Simon Davies wrote: > On 3 January 2015 at 00:12, J Decker wrote: > > Okay... > > https://www.sqlite.org/lang_datefunc.html > > > > https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct > type > > */

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Simon Davies
On 3 January 2015 at 00:12, J Decker wrote: > Okay... > https://www.sqlite.org/lang_datefunc.html > > https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct type > */ Could you point out where exactly > > I understand it's kept as a string... and there's no

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread J Decker
Okay... https://www.sqlite.org/lang_datefunc.html https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct type */ I understand it's kept as a string... and there's no internal functions for this... but wasn't there a discussion to add hex and octal etc support for number

Re: [sqlite] New column in select will not mask column of the same name in having clause and sqlite won't warn

2015-01-02 Thread James K. Lowden
On Sun, 28 Dec 2014 17:46:08 +0100 Tomas Telensky wrote: > select kvadrat, datum, count(distinct kontrola) as pocet > from b > group by kvadrat, datum > having pocet > 1 > > The problem was that pocet was actually a column in table b and I > didn't notice, and the

Re: [sqlite] Client/Server Best Practices

2015-01-02 Thread James K. Lowden
On Thu, 25 Dec 2014 05:32:45 -0700 (MST) Rick Kelly wrote: > All SELECT type requests are wrapped with BEGIN TRANSACTION/COMMIT That shouldn't be necessary and afaik isn't necessary. SELECT does not modify the database. To "commit a select" is to apply the nonchanges. A

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Clemens Ladisch
J Decker wrote: > is this... 2015-01-02 20:47:18 (this is datetime( 'now', '-3600 second' ) > > received = 2015-01-02 13:46:23.818-0800 this is a DATETIME column recorded > in the database SQLite has no DATETIME datatype. This is just a string. > select * from messages where received <

Re: [sqlite] Suggestion for syntax enhancement for virtual tables

2015-01-02 Thread Peter Aronson
If only the xDisconnect method is called on a virtual table create in the temp database at disconnect time, is that the only time xDisconnect will be called? The documentation at sqlite.org doesn't seem to say. Jay Krebich's Using SQLite says xDisconnect is "Called when a database containing

[sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread J Decker
is this... 2015-01-02 20:47:18 (this is datetime( 'now', '-3600 second' ) received = 2015-01-02 13:46:23.818-0800 this is a DATETIME column recorded in the database recieved2 = 2015-01-02 15:46:20.000-0600 this is a DATETIME column recorded in the database 13- (-8) = 21 which is more than NOW

Re: [sqlite] Whish List for 2015

2015-01-02 Thread Philippe Riand
We’ll probably look at providing a set of functions for handling JSON in SQLite, similarly to what POSTGRESQL is doing. But, to make it efficient, we need to index the JSON content. I suggested earlier this year to get expression based indexes, so one can index the result of a function like

Re: [sqlite] Getting SQLITE_IOERR_WRITE when running sqlite

2015-01-02 Thread Zsbán Ambrus
On 1/2/15, Dan Kennedy wrote: > On 01/02/2015 04:44 PM, Waiba, Aswin wrote: >> we were getting SQLITE_IOERR_WRITE (778). > > It means a call to write(), pwrite(), fallocate() or similar has failed. > Because it ran out of disk space, or the media was removed or perhaps is >

Re: [sqlite] Getting SQLITE_IOERR_WRITE when running sqlite

2015-01-02 Thread Dan Kennedy
On 01/02/2015 04:44 PM, Waiba, Aswin wrote: Hi, I am currently using sqlite version 3.7.14 in our application. We are using it via a single thread, however we are getting SQLITE_IOERR (10) when running the application. After enabling the extended result code, we found out that we were

[sqlite] Getting SQLITE_IOERR_WRITE when running sqlite

2015-01-02 Thread Waiba, Aswin
Hi, I am currently using sqlite version 3.7.14 in our application. We are using it via a single thread, however we are getting SQLITE_IOERR (10) when running the application. After enabling the extended result code, we found out that we were getting SQLITE_IOERR_WRITE (778). After going