Re: [sqlite] Why attach databases?

2008-02-07 Thread Dan
On Feb 8, 2008, at 6:10 AM, Jason Tudor wrote: > Thanks for the quick feedback, you all have good points. The data > transfer > example that Sam provided is the most compelling to me. Another reason is that a transaction that writes to more than one attached database is still an atomic

Re: [sqlite] Why attach databases?

2008-02-07 Thread Martin Pelletier
Jason Tudor wrote: > > In order to get the count from a particular table, I could do the following: > > SELECT COUNT id FROM main.table UNION > SELECT COUNT id FROM db2.table > > I would then step through the result and add the two values to get a total > count. That would not be the optimal use

Re: [sqlite] Why attach databases?

2008-02-07 Thread Nicolas Williams
On Thu, Feb 07, 2008 at 06:17:19PM -0500, Samuel R. Neff wrote: > A blanket "stay away" is pretty extreme. I would rather be able to have True. One use case discussed before would be to archive history data from one DB to another, then reset the history tables in the first one.

Re: [sqlite] Why attach databases?

2008-02-07 Thread Samuel R. Neff
, February 07, 2008 5:39 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Why attach databases? Given the restrictions on views and triggers (they cannot make reference to tables from more than one database) I'd say "stay away from ATTACH where possible" -- d

Re: [sqlite] Why attach databases?

2008-02-07 Thread Jason Tudor
Thanks for the quick feedback, you all have good points. The data transfer example that Sam provided is the most compelling to me. I was initially thinking that I could attach every database I had with the same schema and execute queries without specifying database names. It's good to know the

Re: [sqlite] Why attach databases?

2008-02-07 Thread Nicolas Williams
Given the restrictions on views and triggers (they cannot make reference to tables from more than one database) I'd say "stay away from ATTACH where possible" -- don't create new uses of it without good reason. ___ sqlite-users mailing list

Re: [sqlite] Why attach databases?

2008-02-07 Thread Samuel R. Neff
Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Tudor Sent: Thursday, February 07, 2008 5:21 PM To: sqlite-users@sqlite.org Subject: [sqlite] Why attach databases? I have been playing around with attaching databases. I'm not sure what the point is. Assume that I have

Re: [sqlite] Why attach databases?

2008-02-07 Thread David Baird
On Feb 7, 2008 3:21 PM, Jason Tudor <[EMAIL PROTECTED]> wrote: > In general, what is the benefit of attaching databases verses maintaining > multiple connections? Well, let's say that you don't have the same schema in both databases. Attaching two databases allows you to do queries across

[sqlite] Why attach databases?

2008-02-07 Thread Jason Tudor
I have been playing around with attaching databases. I'm not sure what the point is. Assume that I have two databases with the same schema, say db1 and db2, and I attach them to one connection. In order to get the count from a particular table, I could do the following: SELECT COUNT id FROM