[sqlite] Weird CASCADE behavior: bug?

2010-12-15 Thread Duquette, William H (316H)
When I run the following piece of SQL in an empty database, I get a "no such table: main.table_e" error on the second "DROP TABLE" statement: CREATE TABLE table_e ( eid TEXT PRIMARY KEY ); CREATE TABLE table_t ( tid TEXT PRIMARY KEY, value TEXT ); CREATE TABLE table_b ( --

Re: [sqlite] Import/Export with foreign keys

2010-12-13 Thread Duquette, William H (316H)
en if you do all your importing within a single transaction, it won't matter what order you import things. On Mon, Dec 13, 2010 at 11:07 AM, Duquette, William H (316H) < william.h.duque...@jpl.nasa.gov> wrote: > Howdy! > > I've been experimenting with SQLite3's foreign key su

[sqlite] Import/Export with foreign keys

2010-12-13 Thread Duquette, William H (316H)
Howdy! I've been experimenting with SQLite3's foreign key support, and I want to check my understanding. I've got an application that regularly takes a number of tables and exports their contents as plain text, and then later imports it again. If I declare foreign key constraints and enable

Re: [sqlite] pragma foreign_key_list deprecated in 3.7.4?

2010-12-10 Thread Duquette, William H (316H)
On 12/10/10 10:36 AM, "Petite Abeille" wrote: On Dec 10, 2010, at 12:17 PM, Richard Hipp wrote: > I relented on this two days ago. See > http://www.sqlite.org/docsrc/info/d399230aae for the check-in. Version > 3.7.5 will list PRAGMA foreign_key_list as fully

Re: [sqlite] pragma foreign_key_list deprecated in 3.7.4?

2010-12-09 Thread Duquette, William H (316H)
Richard, On 12/8/10 11:44 AM, "Richard Hipp" wrote: On Wed, Dec 8, 2010 at 2:35 PM, Petite Abeille wrote: > Hello, > > The pragma foreign_key_list appears to be deprecated in 3.7.4: > > http://www.sqlite.org/pragma.html#pragma_foreign_key_list > >

Re: [sqlite] EXPLAIN QUERY PLAN

2010-11-30 Thread Duquette, William H (316H)
Thanks, Dan! On 11/30/10 9:05 AM, "Dan Kennedy" <danielk1...@gmail.com> wrote: On 11/30/2010 11:38 PM, Duquette, William H (316H) wrote: > I've just discovered EXPLAIN QUERY PLAN; it looks quite useful, but one part > of the output is somewhat opaque. > > The c

[sqlite] EXPLAIN QUERY PLAN

2010-11-30 Thread Duquette, William H (316H)
I've just discovered EXPLAIN QUERY PLAN; it looks quite useful, but one part of the output is somewhat opaque. The command returns three columns: order, from, and detail. "order" is evidently the order in which the indices are applied; the "detail" explains which table and index is involved.

Re: [sqlite] Queries on PRAGMA table_info()

2010-11-22 Thread Duquette, William H (316H)
Thanks! On 11/22/10 10:26 AM, "Simon Slavin" <slav...@bigfraud.org> wrote: On 22 Nov 2010, at 6:21pm, Duquette, William H (316H) wrote: > PRAGMA table_info(my_table) returns a row for each column in my_table. Is it > possible to do selects on this result set? Nope. T

[sqlite] Queries on PRAGMA table_info()

2010-11-22 Thread Duquette, William H (316H)
Howdy! PRAGMA table_info(my_table) returns a row for each column in my_table. Is it possible to do selects on this result set? Or do you simply have to loop over it, and pull out what you need. Thanks! Will -- Will Duquette -- william.h.duque...@jpl.nasa.gov Athena Development Lead -- Jet

Re: [sqlite] Custom collating sequences and performance

2010-11-19 Thread Duquette, William H (316H)
On 11/18/10 8:57 PM, "Dan Kennedy" <danielk1...@gmail.com> wrote: On 11/19/2010 05:22 AM, Duquette, William H (316H) wrote: > On 11/18/10 2:16 PM, "Drake Wilson"<dr...@begriffli.ch> wrote: > > Quoth "Duquette, William H (316H)"<william.h.d

Re: [sqlite] Custom collating sequences and performance

2010-11-18 Thread Duquette, William H (316H)
On 11/18/10 2:16 PM, "Drake Wilson" <dr...@begriffli.ch> wrote: Quoth "Duquette, William H (316H)" <william.h.duque...@jpl.nasa.gov>, on 2010-11-18 14:08:10 -0800: > It seems to me that it shouldn't be necessary for SQLite to evaluate > FOO's comparison

[sqlite] Custom collating sequences and performance

2010-11-18 Thread Duquette, William H (316H)
Suppose I define a custom collating sequence FOO, and use it on an indexed column: CREATE TABLE mytable (mykey TEXT PRIMARY KEY COLLATE FOO, ...) It seems to me that it shouldn't be necessary for SQLite to evaluate FOO's comparison function when doing queries on mytable; the collation order

Re: [sqlite] sqlite_sequence table

2010-11-16 Thread Duquette, William H (316H)
See my previous e-mail: I was querying temp.sqlite_sequence when I thought I was querying main.sqlite_sequence. Will On 11/16/10 2:22 PM, "Richard Hipp" <d...@sqlite.org> wrote: On Tue, Nov 16, 2010 at 4:31 PM, Duquette, William H (316H) < william.h.duque...@jpl.nasa.gov>

Re: [sqlite] sqlite_sequence table

2010-11-16 Thread Duquette, William H (316H)
_sequence table; they show the sqlite_sequence table as being empty. Will On 11/16/10 1:29 PM, "Gerry Snyder" <mesmerizer...@gmail.com> wrote: On 11/16/2010 2:14 PM, Duquette, William H (316H) wrote: > Howdy! > > According to the docs on sqlite.org, a table with &

Re: [sqlite] sqlite_sequence table

2010-11-16 Thread Duquette, William H (316H)
Yes. I've done a couple of inserts into the table, interspersed with queries to the sqlite_sequence table; they show the sqlite_sequence table as being empty. Will On 11/16/10 1:29 PM, "Gerry Snyder" <mesmerizer...@gmail.com> wrote: On 11/16/2010 2:14 PM, Duquette, Willia

[sqlite] sqlite_sequence table

2010-11-16 Thread Duquette, William H (316H)
Howdy! According to the docs on sqlite.org, a table with "INTEGER PRIMARY KEY AUTOINCREMENT" gets an entry in the sqlite_sequence table. I've got some code that contains such a table; but if I query the sqlite_sequence table I don't see it being updated; it's always empty. Anyone have any