[sqlite] do temporary on-disk databases get cleaned up on abnormal process termination?

2015-08-18 Thread Sam Roberts
The docs say you have to close the DB handle to clean them up. I'm concerned that if a process is SIGKILLed or just exits abruptly that the temporary DBs will accumulate on disk. What mechanism is used to create the temporary files? If the file is unlinked after open, then process exit is

Re: [sqlite] Is there a difference between DELETE and UPDATE/INSERT in terms of syncing to disk?

2011-07-04 Thread Sam Roberts
For the record, the problem was that django (by default) starts a transaction before handing an http request, then commits it after the request is handled. Since we were in the middle of a transaction, all the python/django code we wrote saw the state of the DB as it was partially through a

[sqlite] Is there a difference between DELETE and UPDATE/INSERT in terms of syncing to disk?

2011-06-15 Thread Sam Roberts
I'm posting this for one of my coworkers whos email isn't showing up. -- Forwarded message -- From: Kevin Yoo I am writing a Django app with sqlite. I am using Django’s database hook framework to perform certain actions on sqlite’s db file: namely, whenever

Re: [sqlite] searching with like on FTS3

2010-11-30 Thread Sam Roberts
On Mon, Nov 29, 2010 at 9:08 AM, Pascal Schnurr wrote: > Hi recently I noticed that i can't search with the like '%searchword%' > syntax on an FTS3 virtual table. I'm no expert, but are you sure? This exact example, using LIKE, appears in the FTS3 docs:

Re: [sqlite] accessing table column names other then via pragma, or...

2010-11-09 Thread Sam Roberts
On Tue, Nov 9, 2010 at 9:08 PM, Chris Wolf wrote: > ...can pragma result sets be accessed in other sql statements? > > I wish to use SQLite to perform some data re-formatting, as such, I need > to output the results > in CSV format.  Unfortunately, the ".output" command does

Re: [sqlite] Full text search FTS3 of files

2010-10-18 Thread Sam Roberts
Take a look at the custom tokenizer API. I think tokens returned don't necessarily have to be substrings of the text. So, maybe the text you "tokenize" could be the file path, but the tokens could be things you pull from the contents of the file. Just a thought, Cheers, Sam

[sqlite] how do I get the FTS3 "malformed MATCH expression" error message?

2010-10-06 Thread Sam Roberts
>From the command line, I see: sqlite> SELECT section, count(*) FROM 'index' WHERE name MATCH '"*' GROUP BY section; Error: malformed MATCH expression: ["*] But when I do a prepare/step, I get a much less informative message: int result = sqlite3_prepare_v2(routeDb, sql, -1, , NULL );

Re: [sqlite] Disambiguation of Latin accent characters for FTS3

2010-09-30 Thread Sam Roberts
On Thu, Sep 30, 2010 at 8:36 AM, Travis Orr wrote: > I know it is possible but can't figure out what needs to be done to be able > to make FTS3 see E as being equal to É. And other similar cases. Despite the orthographic similarity, those sounds are as different to French speakers

Re: [sqlite] FTS3 MATCH syntax

2010-09-24 Thread Sam Roberts
I'm not an authority, but I've been using FTS3. FTS3 tokenizes strings on whitespace (and other chars), so I think the best you can do would be something like given:john given:q. It doesn't work really well out of the box for substring matching. On Fri, Sep 24, 2010 at 4:16 PM, GHCS Software

Re: [sqlite] Record corruption on Mac OS X 10.6 (Snow Leopard)

2010-08-16 Thread Sam Roberts
On Mon, Aug 16, 2010 at 9:33 AM, Dario Napolitano wrote: > Hello everyone. > I have developed a conversion tool to generate a SQLite database from a > MySQL one. The tool is a simple C Cocoa application in which I have > statically compiled the amalgamation source

Re: [sqlite] How to import data from stdin?

2010-08-15 Thread Sam Roberts
On Sun, Aug 15, 2010 at 4:40 PM, Peng Yu wrote: > On Sun, Aug 15, 2010 at 5:58 PM, Simon Slavin wrote: >> >> On 15 Aug 2010, at 11:31pm, Peng Yu wrote: >>> sqlite3 main.db < file.txt <> Some of those lines are commands to your Unix shell and others are

Re: [sqlite] Substring (LIKE "%key%") searches, would FTS3 with suffix-tree tokenizer be the fast way?

2010-08-06 Thread Sam Roberts
On Fri, Aug 6, 2010 at 11:32 AM, Scott Hess <sh...@google.com> wrote: > On Thu, Aug 5, 2010 at 12:42 PM, Sam Roberts <vieuxt...@gmail.com> wrote: >> FTS3 only searches full terms/words by default, but I think if I built a >> custom >> tokenizer that returne

Re: [sqlite] Substring (LIKE "%key%") searches, would FTS3 with suffix-tree tokenizer be the fast way?

2010-08-06 Thread Sam Roberts
On Fri, Aug 6, 2010 at 6:11 AM, Adam DeVita wrote: > A variant on Simon's plan. > Are the 10,000 rows static, slowly changing, or frequently changing? Never change, it's read-only. >  Does > it make sense to pre-calculate some counts at the time data is loaded? >  Is >

Re: [sqlite] Substring (LIKE "%key%") searches, would FTS3 with suffix-tree tokenizer be the fast way?

2010-08-05 Thread Sam Roberts
On Thu, Aug 5, 2010 at 1:37 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 5 Aug 2010, at 8:42pm, Sam Roberts wrote: > >> select substr(name,1,1), count(*) from my_table where name like '%e%' >> group by substr(name,1,1); > > If you are constantly goin

[sqlite] Substring (LIKE "%key%") searches, would FTS3 with suffix-tree tokenizer be the fast way?

2010-08-05 Thread Sam Roberts
I'd appreciate any suggestions on good ways to do this, I'm neither an SQL or sqlite expert, so I might be thinking about it all wrong. I have something like a (read-only) address book/rolodex, with interactive searching. As users type into the search box, I need to first know for each section