Re: [sqlite] EXPLAIN QUERY PLAN

2013-11-12 Thread Jay A. Kreibich
, and what the overhead will be in maintaining redundant data. Normalize 'til it hurts. Denormalize 'til it works. (and in that order!) -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people

Re: [sqlite] ALTER COLUMN in sqlite

2013-10-16 Thread Jay A. Kreibich
sqlite_master lets you play a lot of tricks, but it only takes one minor mistake to trash the database. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel

Re: [sqlite] Dynamically generate SQL statements for SQLite

2013-09-14 Thread Jay A. Kreibich
bind parameters. NEVER use string manipulations to deal with literal values... nearly all SQL Injection vulnerabilities could be avoided with this simple rule. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing

Re: [sqlite] Table name length in sqlite affects performance. Why?

2013-09-04 Thread Jay A. Kreibich
thing in a transaction. SQLite is one of the few databases that allows transactions on DDL. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel

Re: [sqlite] recommended extension entry point name

2013-08-30 Thread Jay A. Kreibich
. Easier to just use a custom entry point for all your extensions. Best practices for designing extensions, including entry points are covered in some detail in chapter 9 of the book Using SQLite. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear

Re: [sqlite] curious: Why no shared library or DLL?

2013-08-30 Thread Jay A. Kreibich
-- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson ___ sqlite-users mailing list sqlite

Re: [sqlite] Number of Colum!!!

2013-08-13 Thread Jay A. Kreibich
On Tue, Aug 13, 2013 at 07:41:25PM +0530, techi eth scratched on the wall: Is their any limit on number of Colum in SQLite3 table? Yes. http://www.sqlite.org/limits.html#max_column -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important

Re: [sqlite] can column name come from a table?

2013-07-29 Thread Jay A. Kreibich
if SQLite can do that in SQL; you might have to use the host language. You have to use a host language. Bind parameters in prepared statements also won't work, because you cannot bind an identifier. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear

Re: [sqlite] Passing collation to xBestIndex

2013-07-17 Thread Jay A. Kreibich
under a modern version of SQLite just fine. http://www.sqlite.org/c3ref/module.html -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable

Re: [sqlite] Memory usage of sqlite3

2013-07-15 Thread Jay A. Kreibich
sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela

Re: [sqlite] sqlite3_auto_extension - unloaded DLL issue

2013-07-13 Thread Jay A. Kreibich
of getting things done. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] sqlite3_auto_extension - unloaded DLL issue

2013-07-13 Thread Jay A. Kreibich
that the SQLite APIs are not exported from the plugin's DLL (otherwise the different plugins will clash). -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel

Re: [sqlite] Array Accessing in SQLite3

2013-07-12 Thread Jay A. Kreibich
table. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson ___ sqlite-users

Re: [sqlite] Literature on the information theory behind SQL(lite)?

2013-07-09 Thread Jay A. Kreibich
agree with. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson ___ sqlite-users

Re: [sqlite] SQLite3 extended API usage

2013-07-08 Thread Jay A. Kreibich
://www.sqlite.org/c3ref/free_table.html Which, as the docs state, is not recommended. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] Is there a way to return the row number? (NOTthe rowid)

2013-07-03 Thread Jay A. Kreibich
it, makes life no worse. True, you can sort by random(). The sort *process* must be deterministic, however, or there isn't much point in having a sort. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing

Re: [sqlite] Is there a way to return the row number? (NOTthe rowid)

2013-07-01 Thread Jay A. Kreibich
, but still deterministic. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] Shell: .IMPORT does not seem to obey .BAIL setting

2013-06-30 Thread Jay A. Kreibich
for each error line, and try again.) Is this operation by design or a bug? By design. The .bail configuration applies to processing SQL batch files, not data imports. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Jay A. Kreibich
untangle the quotes. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson ___ sqlite

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Jay A. Kreibich
On Wed, Jun 26, 2013 at 10:53:38AM -0700, Roger Binns scratched on the wall: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26/06/13 05:07, Jay A. Kreibich wrote: A year or so ago there was some effort to write a plug-in that would use the standard Python CSV module (at least, I think

Re: [sqlite] Issue with 2 connections getting out of sync, sample code included

2013-06-25 Thread Jay A. Kreibich
still stands, however... as soon as _step() returns SQLITE_DONE, it is best to call _reset() before doing anything else. _finalize() can also be called if you know you're done with the statement. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear

Re: [sqlite] Problem with getting previous command in shell

2013-06-20 Thread Jay A. Kreibich
with -DHAVE_READLINE -lreadline. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] Obtain limit-less count of previous select

2013-06-11 Thread Jay A. Kreibich
and ORDER BY clauses. I'm pretty sure this would happen on the first _step(), not on _prepare(). Prepare is always nearly instantaneous. Yes. And it isn't always a temporary index. Many times, with an ORDER BY, SQLite will compute (and hold in memory) the full result set. -j -- Jay

Re: [sqlite] select count(*) does not use primary key??

2013-06-06 Thread Jay A. Kreibich
specific... this is standard SQL. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] Serialize an in-memory database

2013-06-05 Thread Jay A. Kreibich
, it shouldn't be all that hard to write, and might come in useful for this and other reasons. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable

Re: [sqlite] query help

2013-05-20 Thread Jay A. Kreibich
on the condition that num2 == num1. Look for rows where num1 is NULL, indicating no join was found. Only works if num1 is never NULL in the DB. I need to run. Perhaps someone else can provide an example if that's not making sense. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H

Re: [sqlite] Create Table oddity

2013-05-19 Thread Jay A. Kreibich
[tApplicationPaths] ( ...[AppID] INTEGER PRIMARY KEY, ...[ApplicationName] CHAR, ...[ApplicationMonitorPath] CHAR, ...[SearchSubDirs] BOOL DEFAULT 1, ...[SearchMask] CHAR DEFAULT (AppID) ); Error: default value of column [SearchMask] is not constant -j -- Jay A. Kreibich

Re: [sqlite] How to read log file format into sqlite database?

2013-05-06 Thread Jay A. Kreibich
virtual tables: http://shop.oreilly.com/product/9780596521196.do The big example in that chapter is about exposing Apache/httpd format log files the database through a virtual table. Example code can be found here: http://examples.oreilly.com/9780596521196/ -j -- Jay A. Kreibich

Re: [sqlite] Feature request: Generate 'INSERT' command

2013-05-02 Thread Jay A. Kreibich
it. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson ___ sqlite-users mailing list

Re: [sqlite] Order of columns in group by statement affects query performance

2013-04-25 Thread Jay A. Kreibich
. Use the out-of-order index. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] Order of columns in group by statement affects query performance

2013-04-25 Thread Jay A. Kreibich
ANALYZE), so at least there's an existing set of weights and assumptions to work from. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable

Re: [sqlite] Programming API vs console

2013-04-24 Thread Jay A. Kreibich
easily open the code up to SQL injection attacks and other problems. For example, if a player's owner string has a quote in it, this code won't work. Using bound parameters fixes all this. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear

Re: [sqlite] Writing in a blob

2013-04-23 Thread Jay A. Kreibich
seeks, an SQLite solution would be a Very Bad Idea. Rather, it is common to base the embedded filesystem off an archive format, like tar. Using IFF files was also popular back on the cartridge days. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear

Re: [sqlite] Variable-length records

2013-04-19 Thread Jay A. Kreibich
On Fri, Apr 19, 2013 at 08:19:57AM +0200, Hick Gunter scratched on the wall: IIRC temporary tables are limited to the connection that creates them. Yes. So are in-memory databases. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important

Re: [sqlite] possible ordering issue since 3.7.15

2013-04-13 Thread Jay A. Kreibich
be identified and fixed early, reducing problems that might be caused by linking against a different version of SQLite. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency

Re: [sqlite] 64bit compatibility warnings

2013-04-09 Thread Jay A. Kreibich
... that is nearly everything these days (and likely *everything* that supports an i64 type, even if running in 32-bit mode), but is not actually fixed by the language. Yeah, I don't buy it either. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear

Re: [sqlite] Bug or some misunderstanding?

2013-04-03 Thread Jay A. Kreibich
habit to get into, but perfectly valid for SQLite: http://www.sqlite.org/lang_expr.html Note that there are two variations of the equals and not equals operators. Equals can be either = or ==. The non-equals operator can be either != or . -j -- Jay A. Kreibich J A Y

Re: [sqlite] ANN: user-defined functions

2013-03-25 Thread Jay A. Kreibich
string and math functions. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] pragma table_info(database.table) not supported

2013-03-20 Thread Jay A. Kreibich
that return tabular data should really be system catalog tables. That way I can use WHERE on them. In the past I've used virtual tables to wrap the PRAGMAs into something that looked and acted more like a real table. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence

Re: [sqlite] pragma table_info(database.table) not supported

2013-03-20 Thread Jay A. Kreibich
On Wed, Mar 20, 2013 at 07:00:29PM +0100, Stephan Beal scratched on the wall: On Wed, Mar 20, 2013 at 6:53 PM, Jay A. Kreibich j...@kreibi.ch wrote: That way I can use WHERE on them. In the past I've used virtual tables to wrap the PRAGMAs into something that looked and acted more

Re: [sqlite] SQLITE_OPEN_MAIN_JOURNAL question

2013-03-17 Thread Jay A. Kreibich
, but the license terms are extremely liberal. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] A question about the ancient history of SQLite triggers

2013-03-05 Thread Jay A. Kreibich
' clause means that trigger 1 will cause trigger 2 to be called etc. In this case, it is any trigger that invokes any other trigger. Prior to 3.6.18 there was no trigger stack and triggers could be only one layer deep. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence

Re: [sqlite] SQLite Pronunciation

2013-02-28 Thread Jay A. Kreibich
an SQL statement vs a SQL statement. (or an SQLite database... it goes on an on). We ended up going with an SQL... because it is more correct for the ess-cue-ell pronunciation. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have

Re: [sqlite] like query

2013-02-26 Thread Jay A. Kreibich
The only issue there is that the default case-insensitive nature of LIKE won't work. Otherwise LIKE should have no problems with matching unicode strings. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing

Re: [sqlite] Return Value from sqlite3_exec()

2013-02-22 Thread Jay A. Kreibich
: updated every single record that met the specified condition. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] BUG? sqlite not reporting error like more than one row returned by a subquery used as an expression

2013-02-20 Thread Jay A. Kreibich
the developer knows what they're doing and do the best it can with what it was given. For good or bad, SQL is definitely a shoot yourself in the foot language. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing

Re: [sqlite] Strange eviction from Linux page cache

2013-02-07 Thread Jay A. Kreibich
code. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson ___ sqlite-users

Re: [sqlite] Are Foreign Keys indexed?

2013-01-23 Thread Jay A. Kreibich
[...] Indices are not required for child key columns but they are almost always beneficial. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them

Re: [sqlite] INSERT OR IGNORE - returning new or existing rowid

2013-01-04 Thread Jay A. Kreibich
, the IGNORE resolution may be triggered by different rows through each index. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable

Re: [sqlite] SQLite :Is there any subtle distinction between UNIQUE and DISTINCT?

2012-12-12 Thread Jay A. Kreibich
or the other. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson ___ sqlite

Re: [sqlite] How to verify referential integrity of SQLite database

2012-12-12 Thread Jay A. Kreibich
know how to react to any errors that might be found. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Jay A. Kreibich
is to edit sqlite_master directly. I know it is all saved as text No, it isn't. That was true of SQLite 2, but SQLite 3 stores types in their native format. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Jay A. Kreibich
On Sun, Dec 02, 2012 at 12:52:33PM -0800, Igor Korot scratched on the wall: Jay, On Sun, Dec 2, 2012 at 12:16 PM, Jay A. Kreibich j...@kreibi.ch wrote: On Sun, Dec 02, 2012 at 11:58:54AM -0800, Igor Korot scratched on the wall: Hi, ALL, ALTER TABLE table_name command does not support

Re: [sqlite] Database size bigger than before deleting records

2012-12-02 Thread Jay A. Kreibich
the database, however. Not to ask the obvious, but are you sure the rows were actually deleted? Was auto-vacuuming on? -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency

Re: [sqlite] Memory using: is it normal

2012-12-01 Thread Jay A. Kreibich
is 1K, but it can be 4K on some Windows systems. That makes the 16MB look a shade big, but it might be about right if you're running on a Windows system, or if you've adjusted the default page size and/or cache size. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence

Re: [sqlite] Foreign keys needing an index

2012-11-30 Thread Jay A. Kreibich
constraint, either the FK is broken or the parent table is broken. ...which is not to say a general purpose tool still needs to deal with this, as there are plenty of broken database designs out there. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear

Re: [sqlite] Converting in-memory sqlite database to char array

2012-11-29 Thread Jay A. Kreibich
the backup API writes the file front to back, especially if the database is modified while the backup is taking place. A custom VFS that just writes the file to a big chunk of memory makes the most sense. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear

Re: [sqlite] Converting in-memory sqlite database to char array

2012-11-29 Thread Jay A. Kreibich
in a restart loop, some people choose to make the backup a more atomic operation by having the backup step function copy all the pages in one go. In that case it is likely that the majority of pages are written out in-order, but I wouldn't want to bank on that. -j -- Jay A. Kreibich J

Re: [sqlite] creating indexes on empty columns

2012-11-25 Thread Jay A. Kreibich
if the column contains a NULL. NULL has a sorting order, and anything that does Rows, Simon, rows... not columns. Watch your terminology or your answers will be more confusing than the questions. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear

Re: [sqlite] creating indexes on empty columns

2012-11-25 Thread Jay A. Kreibich
. Indexes are not magic bullets, and using them properly requires understanding how they work and how they are used. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency

Re: [sqlite] creating indexes on empty columns

2012-11-25 Thread Jay A. Kreibich
On Sun, Nov 25, 2012 at 12:41:21PM -0700, Keith Medcalf scratched on the wall: On Sunday, 25 November, 2012, 11:58, Jay A. Kreibich wrote: each column is usually undesirable. A given SELECT can usually only use one index per query (or sub-query), so it rarely makes sense to stack

Re: [sqlite] in memory to void *data (and back)

2012-11-13 Thread Jay A. Kreibich
to a memory block. Use the backup API to go straight in and out of that, rather then a file. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel

Re: [sqlite] how to select

2012-10-24 Thread Jay A. Kreibich
-- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson ___ sqlite-users mailing list sqlite

Re: [sqlite] VTab xRename

2012-10-23 Thread Jay A. Kreibich
. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson ___ sqlite-users mailing list

Re: [sqlite] Feature request: Add pragma CONCAT_NULL_YIELDS_NULL

2012-10-08 Thread Jay A. Kreibich
() function. That way you get the function you want and the behavior you want. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-28 Thread Jay A. Kreibich
of SQLITE_BUSY errors, however. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] How much disk space is required to checkpoint?

2012-09-28 Thread Jay A. Kreibich
-and-unlink being the standard practice for this kind of thing. It is exactly what I would expect SQLite to be doing with it's temp files. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread Jay A. Kreibich
every problem. Even with a timeout, there are situations when you can still get a locking error and your only choice is to rollback and try again. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing

Re: [sqlite] How much disk space is required to checkpoint?

2012-09-26 Thread Jay A. Kreibich
, many UNIX systems have a tmpfile() or similar library call to do the whole thing... create a unique file in /tmp, open it, unlink it, and return the file pointer. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have

Re: [sqlite] Unofficial poll

2012-09-24 Thread Jay A. Kreibich
life easier, the code simpler, and the database smaller and more compact? Heck, yes. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable

Re: [sqlite] Unofficial poll

2012-09-24 Thread Jay A. Kreibich
text CHECK ( typeof( t ) == 'text' ), r float CHECK ( typeof( r ) == 'real' ), b blob CHECK ( typeof( b ) == 'blob' ) ); -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing

Re: [sqlite] Virtual tables are driving me insane!

2012-09-21 Thread Jay A. Kreibich
working with table scans before you worry about making the VT index aware. A lot of the VT modules I write don't use xBestIndex. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has

Re: [sqlite] Count(*) help

2012-09-17 Thread Jay A. Kreibich
of Relational algebra aside, if you treat NULL as unknown, most of the database operators and functions make sense. http://en.wikipedia.org/wiki/Three-valued_logic -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing

Re: [sqlite] WAL, synchronous=1 and durability

2012-09-10 Thread Jay A. Kreibich
time could corrupt the database in NORMAL mode. But in practice, you are more likely to suffer a catastrophic disk failure or some other unrecoverable hardware fault. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you

Re: [sqlite] WAL, synchronous=1 and durability

2012-09-10 Thread Jay A. Kreibich
) FULL in WAL mode is much faster than FULL in non-WAL mode. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] WAL, synchronous=1 and durability

2012-09-10 Thread Jay A. Kreibich
On Mon, Sep 10, 2012 at 09:50:58PM -0500, Jay A. Kreibich scratched on the wall: On Tue, Sep 11, 2012 at 01:58:23AM +0100, Simon Slavin scratched on the wall: On 11 Sep 2012, at 12:55am, Keith Chew keith.c...@gmail.com wrote: and I know FULL (1) will provide that. The question is why

Re: [sqlite] some questions about sqlite

2012-09-02 Thread Jay A. Kreibich
On Sat, Sep 01, 2012 at 11:56:33PM -0700, J Decker scratched on the wall: On Sat, Sep 1, 2012 at 8:24 PM, Jay A. Kreibich j...@kreibi.ch wrote: On Sat, Sep 01, 2012 at 07:37:04PM -0700, J Decker scratched on the wall: On Sat, Sep 1, 2012 at 7:32 PM, Simon Slavin slav...@bigfraud.org wrote

Re: [sqlite] some questions about sqlite

2012-09-01 Thread Jay A. Kreibich
of connections banging on the same file, but that's true no matter if the connections come from the same process or not. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make

Re: [sqlite] Any plans to provide the sqlite3RunParser in the API

2012-08-13 Thread Jay A. Kreibich
/9780596521196.do -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson ___ sqlite-users

Re: [sqlite] SQLITE_STATIC and temporary data

2012-08-01 Thread Jay A. Kreibich
that subsequence SELECT_ statements actually use this static value that was passed in through the bind function? It would be better to keep the value valid until _reset() or _finalize() is called, but, yes... this use of SQLITE_STATIC is acceptable (and somewhat common). -j -- Jay

Re: [sqlite] SQLITE_STATIC and temporary data

2012-08-01 Thread Jay A. Kreibich
(). But yes... the key is that the memory remains valid for the lifetime of the binding, not the fact that is or isn't statically allocated. -j -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Jay A. Kreibich Sent: Wednesday

Re: [sqlite] C++ - Finalizing my SQLite interface

2012-07-27 Thread Jay A. Kreibich
your application lost track of something, and failed to free a dependent resource. Having your object blindly finalize statements is very likely to leave a dangling pointer elsewhere in the application. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear

Re: [sqlite] select speed

2012-07-19 Thread Jay A. Kreibich
Single table with 20 columns. Unless your data is very unusual. However, insert/updates/deletes are likely to be faster on the smaller tables. Worry about design first, then optimize for speed. Normalize 'till it hurts, denormalize until it works. -j -- Jay A. Kreibich J A Y @ K

Re: [sqlite] (no subject)

2012-07-18 Thread Jay A. Kreibich
-- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson ___ sqlite-users mailing list sqlite

Re: [sqlite] Virtual Tables: xSync without xBegin

2012-07-12 Thread Jay A. Kreibich
list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable

Re: [sqlite] Standalone LUA regex that can be used in sqlite

2012-07-05 Thread Jay A. Kreibich
: sqlite3_auto_extension() http://www.sqlite.org/c3ref/auto_extension.html sqlite3_load_extension() http://www.sqlite.org/c3ref/load_extension.html -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong

Re: [sqlite] When to call VACUUM - revisited

2012-07-05 Thread Jay A. Kreibich
, and then back into a new database file on disk. This will both defragment the file, and make sure it's not using unneeded space. For all intents and purposes, this is what VACUUM does. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread Jay A. Kreibich
it won't work. Also, not to state the obvious, but you can only share a :memory: database across connections that originate from the same process. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong

Re: [sqlite] Bug in sqlite3_step

2012-07-04 Thread Jay A. Kreibich
, -1, stmt, NULL ); sqlite3_free( sql_str ); -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] Bug in sqlite3_step

2012-07-04 Thread Jay A. Kreibich
. Both %q and %Q can be used for values, while %w can be used for identifiers. The sqlite3_*printf() functions will properly quote and sanitize any value in the generated string. There is also a %z and %p, but they're not really important for this discussion. -j -- Jay A. Kreibich J

Re: [sqlite] Bug in sqlite3_step

2012-07-04 Thread Jay A. Kreibich
On Wed, Jul 04, 2012 at 08:29:33AM -0500, Jay A. Kreibich scratched on the wall: On Wed, Jul 04, 2012 at 01:09:01AM -0500, Nico Williams scratched on the wall: But this would just be a glorified (if safer) variant of sqlite3_mprintf() -- for apps that allow users to manipulate the schema

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Jay A. Kreibich
the non-NULL rows: UPDATE table SET column=NULL WHERE column IS NOT NULL; As for sqlite3_changes() returning 0, that doesn't sound right unless you're checking inside the trigger. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Jay A. Kreibich
argument that the trigger is doing exactly what one would expect. You are applying an update operation to every row, and the trigger is firing for every row. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Jay A. Kreibich
the wrong operator. Use WHERE col1 IS NOT ?1 AND... and it all works fine. No surprises there. Oracle has never managed to impress me. I know what you mean. That MySQL database they make is difficult to take seriously. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence

Re: [sqlite] Bug in sqlite3_step

2012-07-03 Thread Jay A. Kreibich
of the fact that CREATE statements are copied into the sqlite_master table as literals, and not re-written? (Is that even true?) -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has

Re: [sqlite] Consequences of lexicographic sorting of keys in SQLite4?

2012-07-02 Thread Jay A. Kreibich
function for inputs and the decoder for all outputs, you should be good. That starts to get deep into your SQL, however. The ability to define native types is similar in complexity to adding user-defined functions. Just a thought. Any opinions? -j -- Jay A. Kreibich J A Y @ K R E I

Re: [sqlite] max size of a TEXT field

2012-07-02 Thread Jay A. Kreibich
, but there is a hard limit of (2^31 - 1), or 2GB. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Jay A. Kreibich
considered to be a feature. -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] sqlite time is 2 hours to late

2012-06-27 Thread Jay A. Kreibich
to the west. (By default all times and dates are UTC.) -j -- Jay A. Kreibich J A Y @ K R E I B I.C H Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. -- Angela Johnson

Re: [sqlite] sqlite time is 2 hours to late

2012-06-27 Thread Jay A. Kreibich
On Wed, Jun 27, 2012 at 05:45:41PM +0200, deltagam...@gmx.net scratched on the wall: Am 27.06.2012 17:40, schrieb Jay A. Kreibich: On Wed, Jun 27, 2012 at 05:37:55PM +0200, deltagam...@gmx.net scratched on the wall: Hello, sqlite3 event.db select datetime('now'); gives me a time

  1   2   3   4   5   6   7   8   9   10   >