Re: [sqlite] [EXTERNAL] Non-keyword quoted identifiers parsed as string literals

2019-09-01 Thread Hick Gunter
This is documented behaviour. Use single quotes for literal strings. SQLite will assume you meant 'literlal' if your write "literal" and there is no column of that name. There is no need to quote names in SQLite unless the name contains non-alpha characters. -Ursprüngliche Nachricht- Vo

[sqlite] http://roaringbitmap.org/

2019-09-01 Thread Robert M. Münch
Hi, I think that SQLite use some bitmap indexes and this here might be of interest if not already used/known: http://roaringbitmap.org/ I think it’s from the same guy how did SIMDJSON. Viele Grüsse. -- Robert M. Münch, CEO Saphirion AG smarter | better | faster http://www.saphirion.com http

[sqlite] Enabling FTS on a view

2019-09-01 Thread Amjith Ramanujam
Hi, I've created a view that is a union of two tables. How can I enable FTS for this view? Since views don't have a "rowid" I'm unable to populate the FTS virtual table with the contents of the view. Is there a workaround for this? Thank you! Amjith _

Re: [sqlite] SQLITE_BUSY, database is locked in "PRAGMA journal_mode"

2019-09-01 Thread Rowan Worth
On Fri, 30 Aug 2019 at 04:18, test user wrote: > B. Is there any method for determining lock transitions for connections? > - Is there an API? > - Would it be possible to use dtrace to instrument SQLite to detect > lock transitions? > - Where should I be looking? > On unix sqlit

Re: [sqlite] select for power-meter accumulated total readings

2019-09-01 Thread Keith Medcalf
Of course, what we are emulating here is called a "Process Historian", common examples being PHD and PI. So, if you make a few minor adjustments, you can make this run just about as fast as a "designed for purpose" Process Historian. The changes are that you need to store the data in an "econo

Re: [sqlite] select for power-meter accumulated total readings

2019-09-01 Thread Keith Medcalf
This will get you the consumption projection for each day in the table (timestamp in s represents the ENDING period you are interested in and you can modify it to whatever interval you want, and of course the final query gets the result). It works by computing the slope from each timestamp to

Re: [sqlite] select for power-meter accumulated total readings

2019-09-01 Thread Petr Jakeš
As far I have ended with following: WITH miniPow as ( select date(TIMESTAMP,'+1 day') as d, max(TOTAL_KWH) mini from power group by date(timestamp) ) , maxiPow as ( select date(TIMESTAMP) as d, max(TOTAL_KWH) maxi from power group by date(timestamp) ) select maxiPow.d, ROUND(maxi-mini, 1) from min

Re: [sqlite] Endless loop possible with simultaneous SELECT and UPDATE?

2019-09-01 Thread Keith Medcalf
On Sunday, 1 September, 2019 11:12, Alexander Vega wrote: >Thank you Keith for your answer. It has led me to more questions. >"though you may or may not have visited all rows" >From the documentation I did not get the impression that you would >ever not visit ALL ROWS at least once. Is there a

Re: [sqlite] Non-keyword quoted identifiers parsed as string literals

2019-09-01 Thread William Chargin
Thank you both for your quick and helpful replies! The `quirks.html` page certainly clears things up. Glad to see that there are new options to disable this; I reached out to the maintainers of the language bindings that I use to see if we can get that enabled [1]. [1]: https://github.com/JoshuaWi

Re: [sqlite] Endless loop possible with simultaneous SELECT and UPDATE?

2019-09-01 Thread Alexander Vega
Thank you Keith for your answer. It has led me to more questions. "though you may or may not have visited all rows" From the documentation I did not get the impression that you would ever not visit ALL ROWS at least once. Is there a technical reason for this? I would assume a full table scan is wa

Re: [sqlite] Non-keyword quoted identifiers parsed as string literals

2019-09-01 Thread Keith Medcalf
On Sunday, 1 September, 2019 00:26, William Chargin wrote: >I tracked down a perplexing issue to the following behavior: >sqlite> CREATE TABLE tab (col); >sqlite> SELECT nope FROM tab; -- fails; good >Error: no such column: nope >sqlite> SELECT "nope" FROM tab; -- works? >s