Re: [sqlite] cygwin and sqlite

2009-09-22 Thread Jim Showalter
The original idea of the i86 segmented architecture was that OSs would be written that created zillions of bite-sized threads, each with its own small address space. Nobody wrote an OS to take advantage of that, and instead the ridiculous "far pointer" was invented to desegment the

Re: [sqlite] cygwin and sqlite

2009-09-22 Thread Jim Showalter
The point I was trying to make is that the majority of commands cygwin supports don't have to do any forking. They could just be method calls. Pipes would be parameters going in and return values coming out, all running in a single process. If fork() is specifically called in a script, then

Re: [sqlite] cygwin and sqlite

2009-09-21 Thread Jim Showalter
I thought you were exaggerating, but this weekend I wrote a script for work that used cygwin. It's unbelievably slow compared to the DOS script it replaced, and it performs mostly the same operations as the DOS script. Which is weird, because they wouldn't have to spawn off separate Windows

Re: [sqlite] SQLite database on a certain high-performance "SSD"

2009-09-21 Thread Jim Showalter
SSDs aren't necessarily faster than disks: http://en.wikipedia.org/wiki/Solid-state_drive#Disadvantages - Original Message - From: "Mark" To: Sent: Monday, September 21, 2009 1:53 PM Subject: [sqlite] SQLite database on a certain

Re: [sqlite] List of active savepoints names

2009-09-21 Thread Jim Showalter
I half get his point--if it's hard to program, then only really good programmers will do it. But that argument has been made against every advance in software development since the profession began. Patchcord-pluggers made fun of switch-flippers. Switch-flippers made fun of microcoders.

Re: [sqlite] looking for a solution of Object/Relation Mapping with sqlite

2009-09-10 Thread Jim Showalter
How complicated are your objects and queries? I've worked with Hibernate (a lot, actually), and it's good for some things and horrible for others and a menace in the hands of the wrong people. There simply is no substitute for understanding your schema and your queries. If you have a good

Re: [sqlite] One more SQL statement question

2009-09-09 Thread Jim Showalter
The not-in subselect could be expensive, depending on table size. If it turns out to be expensive, you might consider reference counting. - Original Message - From: "Dennis Volodomanov" To: "General Discussion of SQLite Database" Sent:

Re: [sqlite] Importing data into SQLite - text files are not really portable

2009-09-09 Thread Jim Showalter
Microsoft also supports an XML standard for import/export. Whenever possible, it should be used instead of CSV. It's not the line-terminators that are the problem--the problem is CSV itself. That's why Microsoft upgraded to supporting XML. They only support CSV for backward-compatibility

Re: [sqlite] Booleans in SQLite

2009-09-07 Thread Jim Showalter
Oracle doesn't have a native boolean type. You have to use INTEGER and interpret it. MySQL doesn't have a boolean type (it's just a synonym for TINYINT). SQL Server doesn't have a boolean type. You have to use BIT and interpret it. - Original Message - From: "Mark Hamburg"

Re: [sqlite] Problems encountered on upgrade from SQLite2 to -3

2009-09-03 Thread Jim Showalter
At the risk of throwing gasoline on a fire... I didn't react badly to Rod's original post. Yes, it could have been worded more diplomatically, but why so thin-skinned about it? He reported some issues. The response was that they weren't issues. Can you see how that might be construed as

Re: [sqlite] Multiple indexes in SQLite, and selecting which to use

2009-08-15 Thread Jim Showalter
09 11:37 PM Subject: Re: [sqlite] Multiple indexes in SQLite, and selecting which to use > > On Aug 15, 2009, at 1:34 PM, Jim Showalter wrote: > >> How will that help him fix this problem, if the problem is that >> SQLite's query optimizer is selecting a suboptimal index to u

Re: [sqlite] Multiple indexes in SQLite, and selecting which to use

2009-08-15 Thread Jim Showalter
How will that help him fix this problem, if the problem is that SQLite's query optimizer is selecting a suboptimal index to use, and there is no way to specify which index to use? - Original Message - From: "Dan Kennedy" To: "General Discussion of SQLite

Re: [sqlite] SQLJet - pure Java implementation of SQLite

2009-08-12 Thread Jim Showalter
Perhaps it would be better to translate the object code. It's also possible to translate bytecode (for example, from Java to .NET). - Original Message - From: "Fred Williams" To: "General Discussion of SQLite Database" Sent: Wednesday,

Re: [sqlite] "Bad CPU type in executable"?

2009-08-09 Thread Jim Showalter
I really really hate top-posting. - Original Message - From: "Dr. David Kirkby" To: "General Discussion of SQLite Database" Sent: Saturday, August 08, 2009 11:28 PM Subject: Re: [sqlite] "Bad CPU type in executable"? > J. King wrote:

Re: [sqlite] FTS and postfix search

2009-08-06 Thread Jim Showalter
words you are searching. - Original Message - From: "Jim Showalter" <j...@jimandlisa.com> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Thursday, August 06, 2009 8:59 AM Subject: Re: [sqlite] FTS and postfix search >

Re: [sqlite] FTS and postfix search

2009-08-06 Thread Jim Showalter
; To: <sqlite-users@sqlite.org> Sent: Thursday, August 06, 2009 6:54 AM Subject: Re: [sqlite] FTS and postfix search > Hi Jim, > > and thank you for the great idea. But I thought it would be possible > to > search '*word*' - but this is not possible with this method either. &g

Re: [sqlite] FTS and postfix search

2009-08-05 Thread Jim Showalter
Sorry--I read my emails arrival order, not reverse chronological--so I didn't see that John had already solved it. - Original Message - From: "John Machin" To: "General Discussion of SQLite Database" Sent: Wednesday, August 05, 2009 6:40

Re: [sqlite] FTS and postfix search

2009-08-05 Thread Jim Showalter
, you don't need to also store them in forward order. Just reverse the strings before displaying them. - Original Message - From: "Jim Showalter" <j...@jimandlisa.com> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Wednesday, Aug

Re: [sqlite] FTS and postfix search

2009-08-05 Thread Jim Showalter
You could store the words reversed (in addition to storing them in forward order). Then like 'xxx%' would be fast. This would double your disk footprint, but could give you the search performance you're looking for. If that's too goofy, you could create a table of all one, two, and

Re: [sqlite] ANN: SQLite 3.6.16.C#

2009-08-02 Thread Jim Showalter
Yes, C# supports native calls. You just call pinvoke. But a pure C# implementation allows it to run in Silverlight and other C# applications where native calls are not allowed. http://sqlite.phxsoftware.com/forums/t/1642.aspx - Original Message - From: "Konrad J Hambrick"

Re: [sqlite] ANN: SQLite 3.6.16.C#

2009-08-02 Thread Jim Showalter
r code for specific hardware you're running on right > now. Or it > can recompile code based on statistics. Options unavailable to > native code. > And after all having managed implementation gives better control on > code, > simpler code and so on. So in reality there should b

Re: [sqlite] ANN: SQLite 3.6.16.C#

2009-08-01 Thread Jim Showalter
Could we not disparage different OSs and languages? A fair comparison of performance isn't between a C and C# implementation of SQLite, but between a C# and Java implementation of SQLite. Both C# and Java are managed languages that run atop a VM that runs atop an OS. C is down on the metal. I

Re: [sqlite] Multi-master replication with updated Versioning extension

2009-07-30 Thread Jim Showalter
MD5 hashes can still collide. How does this implementation deal with hash collisions? - Original Message - From: "Alexey Pechnikov" To: "General Discussion of SQLite Database" Sent: Thursday, July 30, 2009 7:11 AM Subject: Re: [sqlite]

Re: [sqlite] Denormalisation

2009-07-27 Thread Jim Showalter
Try writing apps for cellphones and both space and time become important again! - Original Message - From: "Simon Slavin" To: "General Discussion of SQLite Database" Sent: Monday, July 27, 2009 3:33 PM Subject: Re: [sqlite]

Re: [sqlite] SQLite lock behavior in shared-cache mode

2009-07-27 Thread Jim Showalter
Does SQLite support MVCC (http://en.wikipedia.org/wiki/Multiversion_concurrency_control)? It sounds like it doesn't. Maybe it should--that's a very nice way to support unblocked reads while still getting mutex for writes. - Original Message - From: "Dan" To:

Re: [sqlite] a system for arbitrarily tagging rows in a table

2009-07-25 Thread Jim Showalter
You can have the tags in a separate table that has a foreign-key to the table with the rows in in you want to tag, and then do a select from that table to find the tagged rows. If you need to search for multiple tags at a time, each requires a join: select t from tagged as t join t.tags as

Re: [sqlite] Installing SQLite

2009-07-23 Thread Jim Showalter
Jay, your email below is superb. It's dispassionate, accurate, diplomatic, and informative. I was also disappointed to see this email list go the way of so many others over the past day or so, but it's easy enough to fix it. Stop calling someone else a doofus for selecting a particular OS to

[sqlite] Overhead of indexes?

2009-07-22 Thread Jim Showalter
I have everything working now, and am just tidying up. I want to add indexes, if needed, but this is for a cellphone app, and I'm worried about using up space, particularly when the data is unlikely to be more than a couple thousand rows in total. But there is a query that might be slow

Re: [sqlite] Subqueries

2009-07-21 Thread Jim Showalter
I recommend starting with a smaller query and adding to it. For example, can you do a select count from the table? Then can you do a select * from the table? Then can you do a select * with an order by? And so forth, building up the query one piece at a time until it does what you want. I'm

[sqlite] Resolve: problem getting triggers to work

2009-07-18 Thread Jim Showalter
Android team screwed up. I filed: http://code.google.com/p/android/issues/detail?id=3302 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Updated info on getting trigger to work

2009-07-18 Thread Jim Showalter
I dumped the SQL being executed to a file: drop table if exists Words; create table Words (_id integer primary key autoincrement, text text not null unique); create trigger ut_Words_cannotChangeWordTextOnUpdate before update on Words for each row begin select raise(rollback, 'update on table

Re: [sqlite] Problem getting trigger to work

2009-07-18 Thread Jim Showalter
lt;slav...@hearsay.demon.co.uk> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Friday, July 17, 2009 11:00 PM Subject: Re: [sqlite] Problem getting trigger to work > > On 18 Jul 2009, at 4:32am, Jim Showalter wrote: > >> create table words

[sqlite] Problem getting trigger to work

2009-07-17 Thread Jim Showalter
I have this simple schema: create table words ( _id integer primary key autoincrement, wordText text not null unique ); I have triggers that work, which I got from http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers. Now I'm trying to modify the update trigger to prevent saving a

Re: [sqlite] Raise is not working

2009-07-12 Thread Jim Showalter
: "Simon Slavin" <slav...@hearsay.demon.co.uk> To: "Jim Showalter" <j...@jimandlisa.com>; "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Sunday, July 12, 2009 7:44 PM Subject: Re: [sqlite] Raise is not working > > On 13

Re: [sqlite] Raise is not working

2009-07-12 Thread Jim Showalter
? - Original Message - From: "Jim Showalter" <j...@jimandlisa.com> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Sunday, July 12, 2009 6:10 PM Subject: Re: [sqlite] Raise is not working > Nevermind--for wh

Re: [sqlite] Raise is not working

2009-07-12 Thread Jim Showalter
(TAG, "Error inserting " + values, e); return -1; } } - Original Message - From: "Jim Showalter" <j...@jimandlisa.com> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Sunday, July 12, 2009 6:03

Re: [sqlite] Raise is not working

2009-07-12 Thread Jim Showalter
is the specific error code? Is Android swallowing raised exceptions and turning them all into just -1? - Original Message - From: "Jim Showalter" <j...@jimandlisa.com> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Sunday, July 12, 2009

[sqlite] Raise is not working

2009-07-12 Thread Jim Showalter
Schema: create table words (_id integer primary key autoincrement, wordtext text not null unique); create table definitions (_id integer primary key autoincrement, owningWordId integer not null unique, deftext text not null); create trigger fki_definitions_words_id before insert on

Re: [sqlite] Number truncation problem in SQLite 3

2009-07-12 Thread Jim Showalter
009 4:25 PM Subject: Re: [sqlite] Number truncation problem in SQLite 3 > On 13/07/2009 8:40 AM, Roger Binns wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Jim Showalter wrote: >>> create table words (_id integer primary key autoincrement

[sqlite] Number truncation problem in SQLite 3

2009-07-12 Thread Jim Showalter
create table words (_id integer primary key autoincrement, wordtext text not null unique, timestamp integer not null); public class Word { long _id; String wordtext; long timestamp; } timestamp: before save: 1247435151517 after save : 1247435160847 64-bit max is: