Re: [sqlite] Poll: Include the recent sqlite3_column_name() fix in the upcoming 3.20.0 release?

2017-07-31 Thread Jeffrey Mattox
Is there any way to predict what error a (buggy) legacy app will receive, or is that dependent on the wrapper? Jeff ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] Does prepare do arithmetic?

2017-05-29 Thread Jeffrey Mattox
Why does a complex computation (but still consisting of only constants) make a difference as to whether the computation is performed once or many times? What's the dividing line between "simple" and "complex"? Jeff > On May 29, 2017, at 8:51 AM, Richard Hipp wrote: > > It

Re: [sqlite] Database corruption, and PRAGMA fullfsync on macOS

2017-04-18 Thread Jeffrey Mattox
I'm an iOS and macOS developer. Mac app bundles are special in other ways beside just having a bit set. For one, there's a security check somewhere that verifies that the app bundle has not been changed, as those files are expected to be read-only. Apple says apps should put their data

Re: [sqlite] Indexing WHERE with GROUP BY and ORDER BY

2017-04-02 Thread Jeffrey Mattox
I had nearly the same question a month ago (Subject: Index usefulness for GROUP BY). In my case, the best index was on the WHERE clause because it eliminated the scan and returned only the few important rows for the other clauses. However, the best result will depend on how many rows are

Re: [sqlite] Continuous recovery of journal

2017-04-01 Thread Jeffrey Mattox
>> On Apr 1, 2017, at 10:43 PM, J Decker wrote: > > I can add an idle sweep to close connections when nothing has been in > progress for a while but only on sqlite connections which complicates > things... Why don't you do as Simon suggested ("the application should have

Re: [sqlite] Index usefulness for GROUP BY

2017-03-04 Thread Jeffrey Mattox
uld be the best index). Jeff > On Mar 3, 2017, at 4:29 AM, Jeffrey Mattox <j...@mac.com> wrote: > > Given this DB schema (simplified, there are other columns): > > CREATE TABLE History ( >history_ID INTEGER PRIMARY KEY, >gameCount INTEGER, >weekday

[sqlite] Index usefulness for GROUP BY

2017-03-03 Thread Jeffrey Mattox
Given this DB schema (simplified, there are other columns): CREATE TABLE History ( history_ID INTEGER PRIMARY KEY, gameCount INTEGER, weekday INTEGER, /* 0=Sunday, 6=Saturday */ hour INTEGER, /* (0..23) */ datetime INTEGER /* unix datetime */ ); CREATE INDEX

[sqlite] text/numeric comparison confusion

2017-01-26 Thread Jeffrey Mattox
When used in a SELECT, I expect this comparison to be true (and it is): ( cast('25' as INTEGER) = 25 ) <--- true But, why is this false: ( '25' = 25 ) <--- false? and this is true: ( cast(25 as TEXT) = 25 ) <--- true So, being that second comparison is false (why?), then why isn't

[sqlite] Finding the largest TOTAL() of numerous GROUP totals

2017-01-24 Thread Jeffrey Mattox
I use this query to get a grand total of a number of counts: (1) SELECT TOTAL(count) as grandTotalCount FROM History Next, I step through the counts, grouped by column 'hour: (2a) SELECT TOTAL(count) as subTotalCount, hour FROM History GROUP BY hour I use grandTotalCount in the loop to

[sqlite] Advice on using dates and hours for bin counts, time-zone agnostic

2017-01-10 Thread Jeffrey Mattox
My application will be counting events and saving the totals for every 15-minute time period over many days -- that table will have an eventCount and a date/time for each bin. I'll be displaying the data as various histograms: the number of events per day over the year (365 values), the number

Re: [sqlite] Changing ID's to UUID

2016-11-16 Thread Jeffrey Mattox
On Nov 16, 2016, at 8:46 AM, Richard Hipp wrote: > >> On 11/16/16, Keith Medcalf wrote: >> What I do not >> understand is why one would use a UUID (randomly generated bunch of bytes) >> as a key in a database. It is long, every use must be checked for >>

Re: [sqlite] SQL / SQLite for Beginners

2016-05-25 Thread Jeffrey Mattox
The concept is good, but I immediately noticed your pronunciation of SQLite and recall the recent discussion about that. The conclusion was that any pronunciation is okay, but I think the the most common is "es-que-el-ite" (and that's Dr. Hipp's). My point is, I was distracted throughout the

[sqlite] Write-Ahead Logging -- documentation error

2016-05-25 Thread Jeffrey Mattox
This page: https://www.sqlite.org/wal.html Contains the phrase, "... the checkpoint must stop when it reaches a page in the WAL that is past the read mark of any current reader." The term, "read mark" is not defined on that page. Should that be "end mark"? Jeff

[sqlite] Incremental backup/sync facility?

2016-05-06 Thread Jeffrey Mattox
As an aside, this is how Apple syncs Core Data to iCloud (and then to multiple iOS devices) if the backing store uses SQLite (the default). When a small amount of data changes (which is common), the changes get send out, not the entire (mostly unchanged and potential huge) database. Jeff >

[sqlite] whish list for 2016

2015-12-25 Thread Jeffrey Mattox
> On Dec 25, 2015, at 12:51 PM, Stephen Chrzanowski > wrote: > > *Part 2;* > > More along with your application style, but a complete database schema > overhaul, think of a contact form that allows for multiple methods of > communication. Multiple email addresses, multiple phone or fax

[sqlite] ESC_BAD_ACCESS when using a background thread

2015-09-02 Thread Jeffrey Mattox
>> On Sep 1, 2015, at 9:37 AM, Roger Binns wrote: >> >> On 08/31/2015 11:28 PM, Jeff M wrote: >> All my bad -- I'm fessing up. > > Can you tell us how you found the root causes of the problems? It > would be nice to know what tools and techniques worked. > Roger Since you asked... The crash

[sqlite] When sqlite3_close() returns SQL_BUSY

2015-08-22 Thread Jeffrey Mattox
No, I needed to set a timeout (see previous messages in this thread). I've fixed my problem. I'm suggesting now that the documentation for SQLITE_BUSY is incomplete. Jeff > On Aug 22, 2015, at 5:13 AM, Eduardo Morras wrote: > > On Sat, 22 Aug 2015 05:07:55 -0500 > Jeff M wrote: > >> The

[sqlite] order by not working in combination with random()

2015-08-17 Thread Jeffrey Mattox
Could the random() be made part of an expression (that doesn't change the result) to fool the optimizer into only doing the random() once, like this: SELECT ( random() * col_thats_always_one ) AS x FROM table ORDER BY x Jeff > On Aug 17, 2015, at 5:01 AM, Clemens Ladisch wrote: > > select