Re: [sqlite] Porting SQLite to another operating system (not supported out of the box)

2015-02-10 Thread Jay Kreibich
On Feb 10, 2015, at 11:21 AM, Peter Aronson pbaron...@att.net wrote: You could add VFS creation if you ever do a revised edition (along with a virtual table example that actually used xBestIndex and xFilter…) Given that the book is over four years old and covers to the end of SQLIte3

Re: [sqlite] Porting SQLite to another operating system (not supported out of the box)

2015-02-10 Thread Jay Kreibich
:27 PM, Janke, Julian julian.ja...@capgemini.com wrote: So my question is, if there is any additional information, how to write a VFS? Or does anyone have a clue how to start best? This book: http://www.amazon.de/Using-SQLite-Jay-Kreibich-ebook/dp/B008IGK5QM/ resp. http

Re: [sqlite] TEMP tables with the same name as of main tables

2015-01-23 Thread Jay Kreibich
On Jan 23, 2015, at 9:35 AM, Aldo Buratti aldo.w.bura...@gmail.com wrote: I had a bad programming experience with temporary tables and after some googling I found this old post [sqlite] How to select from a temp table with same name as a main table. dochsm Tue, 18 Jun 2013 05:39:04

Re: [sqlite] LIKE vs GLOB vs MATCH vs REGEXP

2015-01-16 Thread Jay Kreibich
On Jan 16, 2015, at 5:06 AM, Scott Robison sc...@casaderobison.com wrote: LIKE GLOB can be overridden with user defined functions. According to https://www.sqlite.org/lang_corefunc.html LIKE can be a 2 or 3 argument function, GLOB can be a 2 argument function, and neither MATCH nor REGEXP

Re: [sqlite] LIKE vs GLOB vs MATCH vs REGEXP

2015-01-16 Thread Jay Kreibich
On Jan 16, 2015, at 6:56 AM, Richard Hipp d...@sqlite.org wrote: On 1/16/15, Scott Robison sc...@casaderobison.com wrote: LIKE GLOB can be overridden with user defined functions. According to https://www.sqlite.org/lang_corefunc.html LIKE can be a 2 or 3 argument function, GLOB can be a 2

Re: [sqlite] VACUUM requires 6.7 times space ?

2015-01-05 Thread Jay Kreibich
On Jan 5, 2015, at 8:43 AM, Nelson, Erik - 2 erik.l.nel...@bankofamerica.com wrote: RSmith wrote on Monday, January 05, 2015 7:43 AM On 01/05/2015 06:22 PM, Simon Slavin wrote: I have a database file which is 120GB in size. It consists of two huge tables and an index. //...

Re: [sqlite] VACUUM requires 6.7 times space ?

2015-01-05 Thread Jay Kreibich
On Jan 5, 2015, at 5:03 PM, Eduardo Morras emorr...@yahoo.es wrote: On Mon, 5 Jan 2015 14:42:28 -0600 Jay Kreibich j...@kreibi.ch wrote: On Jan 5, 2015, at 12:25 PM, Jim Wilcoxson pri...@gmail.com wrote: Simon - instead of using vacuum, it's much faster to create a new database from

Re: [sqlite] Error: database disk image is malformed

2015-01-05 Thread Jay Kreibich
On Jan 4, 2015, at 3:31 AM, Neo Anderson neo_in_mat...@msn.com wrote: I have a customer database which appears corrupt. When I run sqlite3 mydb and PRAGMA integrity_check I got (literally, no other lines): Error: database disk image is malformed However, I can .dump and .read to create

Re: [sqlite] VACUUM requires 6.7 times space ?

2015-01-05 Thread Jay Kreibich
On Jan 5, 2015, at 12:25 PM, Jim Wilcoxson pri...@gmail.com wrote: Simon - instead of using vacuum, it's much faster to create a new database from the old one, then rename it. It's easy to do this in Python using iterdump(), or you can connect to the new (empty) database, do your create

Re: [sqlite] Virtual table implementation details

2014-11-20 Thread Jay Kreibich
You seem to be forgetting one important detail… if a Rollback is called, the underlying data and undo tables will be rolled back automatically. They are, after all “real” tables in the database, and will be managed as such. Unless you’re storing data outside the SQLite database, there is

Re: [sqlite] Views as Virtual Tables -- Command line vs. Called Interface

2014-08-01 Thread Jay Kreibich
When the command line and an application do different things, it is usually a versioning issue. I’d verify what version of the SQLite library your Python application is using. My guess is something older, possibly with a bug or edge-case in the way it handles aliasing of views. -j On

Re: [sqlite] Bug in division?

2014-05-06 Thread Jay Kreibich
On May 6, 2014, at 4:29 PM, John Drescher dresche...@gmail.com wrote: Interesting. It makes NO sense to return 0 when dividing two integers. Never took a C/C++ class? The system does not return 0 any time you divide two integers, but it does return zero for 2 / 4. After all, how

Re: [sqlite] Bug in division?

2014-05-06 Thread Jay Kreibich
On May 6, 2014, at 5:26 PM, Gene Connor neothreeei...@hotmail.com wrote: Subject: Re: [sqlite] Bug in division? From: j...@kreibi.ch Date: Tue, 6 May 2014 17:02:02 -0500 CC: neothreeei...@hotmail.com To: sqlite-users@sqlite.org The system does not return 0 any time you divide two

Re: [sqlite] select 1 where 1 - 1;

2014-05-05 Thread Jay Kreibich
The WHERE clause takes only one parameter. WHERE expects an expression, which evaluates down to one value. That expression does not need to be a comparison. It commonly is, but it can be anything, such as a CASE expression, an EXISTS subselect, or a function. As far as SQLite cares, all

Re: [sqlite] select 1 where 1 - 1;

2014-05-05 Thread Jay Kreibich
On May 5, 2014, at 3:03 PM, Petite Abeille petite.abei...@gmail.com wrote: On May 5, 2014, at 9:15 PM, RSmith rsm...@rsweb.co.za wrote: Je suis desole mon ami… Moi aussi :P I have no quarrel with you, good Sir Knight, but I must cross this bridge: select 1 where 1 is 1; select 1

Re: [sqlite] select 1 where 1 - 1;

2014-05-05 Thread Jay Kreibich
On May 5, 2014, at 6:16 PM, Scott Robison sc...@casaderobison.com wrote: On Mon, May 5, 2014 at 4:15 PM, Jay Kreibich j...@kreibi.ch wrote: So far this whole discussion seems to boiled down to the fact that SQLite doesn’t have a native Boolean type. That’s it. No, it doesn’t. Once we

Re: [sqlite] select 1 where 1 - 1;

2014-05-02 Thread Jay Kreibich
On May 2, 2014, at 10:07 PM, Keith Medcalf kmedc...@dessus.com wrote: On May 2, 2014, at 8:54 PM, Richard Hipp d...@sqlite.org wrote: I'm guessing that Mr. Abeille is upset that SQLite ... ... doesn't even bother with SQL syntax and will happily accept any old junk as a sorry excuse

Re: [sqlite] Bug in division?

2014-04-30 Thread Jay Kreibich
On Apr 30, 2014, at 1:00 PM, Petite Abeille petite.abei...@gmail.com wrote: On Apr 30, 2014, at 2:22 PM, John McKown john.archie.mck...@gmail.com wrote: PostgreSQL likewise returns 0 for 2/4 and .5 for 2/4.0 . This is likely a part of the SQL standard. Just to be contrarian, Oracle

Re: [sqlite] Proposed enhancement to the sqlite3.exe command-line shell

2014-02-10 Thread Jay Kreibich
On Feb 10, 2014, at 10:15 AM, Richard Hipp d...@sqlite.org wrote: What if, instead of opening a standard database, the sqlite3.exe command-line shell just issued a warning message reminding the user that they are working on a transient in-memory database and suggesting the use of the .open

Re: [sqlite] Proposed enhancement to the sqlite3.exe command-line shell

2014-02-10 Thread Jay Kreibich
On Feb 10, 2014, at 10:20 AM, Jay Kreibich j...@kreibi.ch wrote: On Feb 10, 2014, at 10:15 AM, Richard Hipp d...@sqlite.org wrote: What if, instead of opening a standard database, the sqlite3.exe command-line shell just issued a warning message reminding the user that they are working

Re: [sqlite] pragmas in subselects?

2014-01-26 Thread Jay Kreibich
Chapter 10 of Using SQLite covers virtual tables. One of the examples given shows how to wrap a PRAGMA statement, so it can be used as system catalog and used in normal SELECT statements. It would be pretty easy to expand the given example to cover almost any SQL statement (including any

Re: [sqlite] Do I really need rollback after sqlite3_step returns BUSY?

2014-01-07 Thread Jay Kreibich
On Jan 7, 2014, at 4:13 AM, Woody Wu narkewo...@gmail.com wrote: Thanks for the clear guide. _busy_timeout is easier to use. By the way, i want confirm that if i am not in an explicit transaction, i can simply redo the _step() invoking, right? No. You executed a statement. Regardless of

Re: [sqlite] Using SQLite by Jay Kreibich (2010 paperback edition)

2013-12-31 Thread Jay Kreibich
, 2013, at 8:48 PM, Bob Cochran bcochra...@verizon.net wrote: I'm working on a tough project that requires me to use Node.js and SQLite. I'm building a database with SQLite version 3.8.2. My question is, would purchasing the book Using Sqlite by Jay Kreibich still be mostly pertinent

Re: [sqlite] Using SQLite by Jay Kreibich (2010 paperback edition)

2013-12-31 Thread Jay Kreibich
Yes, of course. Sorry. It would seem I shouldn't answer email that early in the morning on a day off. -j On Dec 31, 2013, at 7:48 AM, Stephan Beal sgb...@googlemail.com wrote: On Tue, Dec 31, 2013 at 2:33 PM, Jay Kreibich j...@kreibi.ch wrote: Using SQLite covers up to the very last

Re: [sqlite] Why can't SQLite drop columns?

2012-10-08 Thread Jay Kreibich
On Oct 8, 2012, at 3:36 PM, Darren Duncan dar...@darrenduncan.net wrote: Petite Abeille wrote: On Oct 8, 2012, at 10:12 PM, Richard Hipp d...@sqlite.org wrote: ALTER TABLE DROP COLUMN requires writing every row of the table. Could be a 'logical delete' instead. In other words, a dictionary

Re: [sqlite] inaccuracy in code/docu of sqlite3_finalize

2011-10-13 Thread Jay Kreibich
Sent from my iPhone On Oct 13, 2011, at 12:45 AM, Wolfgang Stöcher wolfg...@stoecher.com wrote: From the docu of sqlite3_finalize: The application must finalize every prepared statement [1] in order to avoid resource leaks. Ok, fine. But the given reason(s) seem not to be complete. After

Re: [sqlite] PRAGMA user_version

2011-09-03 Thread Jay Kreibich
On Sep 3, 2011, at 8:21 PM, Walter rick...@iinet.net.au wrote: Thank you Igor I had the database name but did not think of the the dot in between. Perhaps some one could update the documentation to show this Cheers everyone Walter Please see PRAGMA Command Syntax

Re: [sqlite] Question about database design

2011-02-03 Thread Jay Kreibich
On Feb 3, 2011, at 3:38 AM, Simon Slavin slav...@bigfraud.org wrote: SQLite creates some indexes the programmer doesn't specifically ask for: on the rowid, on the primary key, and on any column declared as UNIQUE. Of course, in a particular table all three of these might actually be the