[sqlite] datetime result help

2015-07-29 Thread R.Smith
On 2015-07-29 08:58 PM, jose isaias cabrera wrote: > > > There will be entries longer than 1 day, so I will have to address > than. Thanks for the help, but this is great, though. If I need more > help, I will come back, but I have enough, and I "I think" I can > figure out those longer hours

[sqlite] Using SQLite as a column-store database?

2015-07-29 Thread Jean Chevalier
Would it be realistic to pretend to use SQLite as a column-store database by leveraging ALTER TABLE ... ADD COLUMN massively and to expect better performance? Suppose that instead of defining a table like CREATE TABLE (key, c1, c2, ... cn) I defined it as CREATE TABLE (key) followed by n-times

[sqlite] Using SQLite as a column-store database?

2015-07-29 Thread Simon Slavin
On 29 Jul 2015, at 8:28pm, Jean Chevalier wrote: > Would it be realistic to pretend to use SQLite as a column-store database by > leveraging ALTER TABLE ... ADD COLUMN massively and to expect better > performance? Sorry. No. The data for each row is stored together. > Suppose that instead

[sqlite] datetime result help

2015-07-29 Thread R.Smith
Adapted to allow variable hours: Assuming you have in your code a variable set for the hours, let's assume some PHP and call it $hrs: SELECT (CASE WHEN datetime( 'now', '+".$hrs."' hours', 'localtime') <= (date( 'now', 'localtime')||' 17:00:00') THEN datetime( 'now', '+".$hrs."' hours',

[sqlite] Importing CSV empty strings as nulls?

2015-07-29 Thread Jean Chevalier
Question: I wished to import a CSV file representing nulls as empty strings (nothing between the commas). I observed that the .import command by default imports those as empty strings. A minimalistic example: Let's create a table T with a single column (c) and a file containing only one new

[sqlite] datetime result help

2015-07-29 Thread R.Smith
On 2015-07-29 08:00 PM, jose isaias cabrera wrote: > > Doctor Hipp wrote... > >> On 7/29/15, jose isaias cabrera wrote: >> >> SELECT >> CASE WHEN time('now','+5.5 hours','localtime') > '17:00:00' >> THEN datetime('now','+21.0 hours','localtime') >> ELSE datetime('now','+5.5

[sqlite] datetime result help

2015-07-29 Thread R.Smith
Oops, rereading your message it seems you need only the difference carried over to the next day, not schedule the entire time-slot on the next day, this will work better for that: WITH DTVals( EndOfToday, NewTimeToday, NewTimeTomorrow ) AS ( SELECT datetime( 'now', 'start of day', '+17

[sqlite] datetime result help

2015-07-29 Thread R.Smith
On 2015-07-29 06:34 PM, jose isaias cabrera wrote: > Greetings! > > I am trying to calculate a date using sqlite date and time functions. > Perhaps, one of you GURUs can help this poor soul. I have been trying to > figure it out, but I know I am lack the understanding. I read the >

[sqlite] Thanks SQLite

2015-07-29 Thread Richard Hipp
On 7/29/15, R.Smith wrote: > > I just wish to ... display my gratitude ... for ... CTE's. > Glad you find them useful. I'm looking for real-world (open-source) use cases for CTEs. Please send me links find any. I have spotted a few CTEs used in Firefox. For example, when rearranging the

[sqlite] SQLite 3.8.11 don't compile in VS9 for CE6/CE7 RELEASEtarget

2015-07-29 Thread Richard Hipp
On 7/29/15, Joe Mistachkin wrote: > > Christian Nols wrote: >> >> Commenting >> #include >> seems to work around it >> > > I've added support for the SQLITE_DISABLE_INTRINSIC define (on trunk). To amplify what Joe said, the changes can be seen here:

[sqlite] sqlite3session

2015-07-29 Thread Marco Bambini
Is the sqlite3session module still available and supported? If not is there a replacement/workaround for it? Thanks a lot. -- Marco Bambini http://www.sqlabs.com http://twitter.com/sqlabs http://instagram.com/sqlabs

[sqlite] Access Violation in fts5_expr()

2015-07-29 Thread Ralf Junker
This SQL SELECT fts5_expr(); results in an AV here: https://sqlite.org/src/artifact/56dcbcbdc9029dd7?ln=145 Reason is that fts5ExprFunction() does not check for at least one argument to fts5_expr() here: http://sqlite.org/src/artifact/56dcbcbdc9029dd7?ln=1886 Ralf

[sqlite] datetime result help

2015-07-29 Thread jose isaias cabrera
"R.Smith" wrote... > Adapted to allow variable hours: > > Assuming you have in your code a variable set for the hours, let's assume > some PHP and call it $hrs: > > SELECT (CASE > WHEN datetime( 'now', '+".$hrs."' hours', 'localtime') <= (date( > 'now', 'localtime')||' 17:00:00') THEN

[sqlite] SQLite 3.8.11 don't compile in VS9 for CE6/CE7 RELEASEtarget

2015-07-29 Thread Joe Mistachkin
Christian Nols wrote: > > Commenting > #include > seems to work around it > I've added support for the SQLITE_DISABLE_INTRINSIC define (on trunk). When this is defined for a project, it should prevent that header file from being included. Thanks for the report. -- Joe Mistachkin

[sqlite] datetime result help

2015-07-29 Thread jose isaias cabrera
"R.Smith" wrote, > Oops, rereading your message it seems you need only the difference carried > over to the next day, not schedule the entire time-slot on the next day, > this will work better for that: > > WITH DTVals( EndOfToday, NewTimeToday, NewTimeTomorrow ) AS ( > SELECT >

[sqlite] datetime result help

2015-07-29 Thread jose isaias cabrera
"R.Smith" wrote... > > On 2015-07-29 08:00 PM, jose isaias cabrera wrote: >> >> Doctor Hipp wrote... >> >>> On 7/29/15, jose isaias cabrera wrote: >>> >>> SELECT >>> CASE WHEN time('now','+5.5 hours','localtime') > '17:00:00' >>> THEN datetime('now','+21.0 hours','localtime') >>>

[sqlite] datetime result help

2015-07-29 Thread jose isaias cabrera
"R.Smith" wrote, > On 2015-07-29 06:34 PM, jose isaias cabrera wrote: >> Greetings! >> >> I am trying to calculate a date using sqlite date and time functions. >> Perhaps, one of you GURUs can help this poor soul. I have been trying to >> figure it out, but I know I am lack the understanding.

[sqlite] datetime result help

2015-07-29 Thread jose isaias cabrera
Doctor Hipp wrote... > On 7/29/15, jose isaias cabrera wrote: >> >> Greetings! >> >> I am trying to calculate a date using sqlite date and time functions. >> Perhaps, one of you GURUs can help this poor soul. I have been trying to >> figure it out, but I know I am lack the understanding. I

[sqlite] datetime result help

2015-07-29 Thread Richard Hipp
On 7/29/15, jose isaias cabrera wrote: > > Greetings! > > I am trying to calculate a date using sqlite date and time functions. > Perhaps, one of you GURUs can help this poor soul. I have been trying to > figure it out, but I know I am lack the understanding. I read the > documentation for it,

[sqlite] sqlite3session

2015-07-29 Thread Richard Hipp
On 7/29/15, Marco Bambini wrote: > Is the sqlite3session module still available and supported? > If not is there a replacement/workaround for it? > Sessions is actively supported. It is found on a branch of the source tree, though. We do not provide tarballs or precompiled binaries for

[sqlite] datetime result help

2015-07-29 Thread jose isaias cabrera
Greetings! I am trying to calculate a date using sqlite date and time functions. Perhaps, one of you GURUs can help this poor soul. I have been trying to figure it out, but I know I am lack the understanding. I read the documentation for it, https://www.sqlite.org/lang_datefunc.html but I

[sqlite] FTS5 xColumnSize() documentation

2015-07-29 Thread Ralf Junker
From fts5aux.test 2.3 I conclude that the FTS5 xColumnSize() function accepts negative column values and returns the total token size of all columns from the current row: https://www.sqlite.org/src/artifact/8c687c948cc98e9a?ln=64-66 Indeed, this is also in source:

[sqlite] datetime start of day result

2015-07-29 Thread jose isaias cabrera
"Hick Gunter" wrote... > You are converting the "start of day" (UTC) to "localtime". Your timezone > is obviously 4 hours behind UTC... > > asql> SELECT datetime('now'), > datetime('now','localtime'),datetime('now','start of > day'),datetime('now','localtime','start of

[sqlite] datetime start of day result

2015-07-29 Thread RafaƂ Ponikwia
On 2015-07-29 07:03, jose isaias cabrera wrote: > sqlite> select datetime('now','start of day','localtime'); > 2015-07-28 20:00:00 I think, in your case in first resets hours for UTC time, and then changes to your local time. Try to change order of arguments (this should first change date to

[sqlite] datetime start of day result

2015-07-29 Thread jose isaias cabrera
"Rafal Ponikwia" wrote... > On 2015-07-29 07:03, jose isaias cabrera wrote: >> sqlite> select datetime('now','start of day','localtime'); >> 2015-07-28 20:00:00 > > I think, in your case in first resets hours for UTC time, and then > changes to your local time. > Try to change order of

[sqlite] datetime start of day result

2015-07-29 Thread Hick Gunter
You are converting the "start of day" (UTC) to "localtime". Your timezone is obviously 4 hours behind UTC... asql> SELECT datetime('now'), datetime('now','localtime'),datetime('now','start of day'),datetime('now','localtime','start of day'),datetime('now','start of day','localtime');

[sqlite] datetime start of day result

2015-07-29 Thread jose isaias cabrera
Greetings! if I run this command on the sqlite3 command tool, select datetime('now','localtime'); I get, sqlite> select datetime('now','localtime'); 2015-07-29 00:48:07 which is correct. When I run this command, sqlite> select datetime('now','start of day','localtime'); 2015-07-28 20:00:00

[sqlite] Query takes 8 seconds on one machine but I abort after 40+ minutes on other machines

2015-07-29 Thread Reinhard Max
On Tue, 28 Jul 2015 at 20:55, rotaiv wrote: > I upgraded to the latest version and it decreased to 16 seconds. > With indexes, 5 seconds. :-D Is index creation time included in those 5 seconds? If your database gets created from scratch and only used once every time you do the syncing (as it

[sqlite] Query takes 8 seconds on one machine but I abort after 40+ minutes on other machines

2015-07-29 Thread R.Smith
On 2015-07-28 09:25 PM, rotaiv wrote: > Not quite. The older version brought it down to 8 seconds (as compared to > 5 seconds) but still a whole lot better than 40+ minutes. > > It is very interesting to see an index can make such a remarkable > difference in that particular scenario. This is