Re: [RDBO] cached DBI handles

2007-10-28 Thread Graham Barr
On Oct 27, 2007, at 12:18 PM, John Siracusa wrote: > Er, wasn't the original point of new_or_cached() to return a > preexisting Rose::DB object, not a new Rose::DB object with a > preexisting $dbh? Maybe I'm mis-remembering... That is what I remember too. The problem that I had when using conn

Re: [RDBO] neutralizing Rose::DB's reference counting

2007-09-26 Thread Graham Barr
On Sep 26, 2007, at 5:28 PM, Jonathan Swartz wrote: > I find Rose::DB's reference counting of DBI handles confusing, and > would like to effectively neutralize it for my entire project. For > example I want > > $dbh = Rose::DB->new()->dbh > > to work even though it is incorrect (because it is s

Re: [RDBO] Bug? Can't set column with a default to NULL

2007-09-07 Thread Graham Barr
On Sep 7, 2007, at 1:13 PM, Peter Karman wrote: > On 09/07/2007 01:03 PM, Graham Barr wrote: > >> >> IMO, default value should only be used during create when a value is >> not specified by the user. At all other times the method should >> return whatever value t

Re: [RDBO] Bug? Can't set column with a default to NULL

2007-09-07 Thread Graham Barr
On Sep 7, 2007, at 1:49 PM, John Siracusa wrote: > On 9/7/07, Peter Karman <[EMAIL PROTECTED]> wrote: >> On 09/07/2007 01:03 PM, Graham Barr wrote: >>> IMO, default value should only be used during create when a value is >>> not specified by the user. At

Re: [RDBO] Bug? Can't set column with a default to NULL

2007-09-07 Thread Graham Barr
On Sep 7, 2007, at 7:23 AM, John Siracusa wrote: > On 9/7/07 12:04 AM, Ask Bjørn Hansen wrote: >> On Sep 6, 2007, at 7:16 PM, John Siracusa wrote: >>> Or I suppose you could do the reverse, requiring a "special" >>> value to >>> trigger the use of a default and leaving undef as the null stand-i

Re: [RDBO] Still fighting with transactions

2007-08-18 Thread Graham Barr
On Aug 17, 2007, at 3:53 PM, John Siracusa wrote: >>> Finally, I suppose I could change the default implementation of >>> init_db() to be more like this instead: >>> >>> sub init_db { $DB ||= Rose::DB->new } >>> >>> But that'd be quite a behavior change, and it'd have its own set >>> of probl

Re: [RDBO] Still fighting with transactions

2007-08-15 Thread Graham Barr
On Aug 15, 2007, at 7:56 PM, John Siracusa wrote: > On 8/15/07, Graham Barr <[EMAIL PROTECTED]> wrote: >> On Wed, August 15, 2007 7:54 am, John Siracusa wrote: >>> The real question is, why is some_helper_that_uses_db() causing a >>> rollback? >>> Tu

Re: [RDBO] Still fighting with transactions

2007-08-15 Thread Graham Barr
On Wed, August 15, 2007 7:54 am, John Siracusa wrote: > The real question is, why is some_helper_that_uses_db() causing a > rollback? > Turn on DBI->trace(1) to be sure it actually is, and maybe try to create a > small test case. the problem is in init_dbh. Rose::DB does not know that the $dbh it

Re: [RDBO] Last call before 0.761

2007-02-21 Thread Graham Barr
On Wed, February 21, 2007 4:14 pm, Michael Reece wrote: > i am curious, if you "set sql_mode=strict_trans_tables;", what > happens if you "insert into bars set id=1;" (with the original schema > that had an id column, of course)? > > does it give the "cannot be null" error? Yes. You get mysql> in

Re: [RDBO] New Manager argument forms

2007-02-17 Thread Graham Barr
On Feb 16, 2007, at 7:26 PM, Jonathan Vanasco wrote: > > On Feb 16, 2007, at 1:11 PM, John Siracusa wrote: > >> Con: small additional overhead to check and coerce the args > > wouldn't that require all of these get_objects parameters to now > become reserved words, unusable as column names ? ( w

Re: [RDBO] Only the first unique key is used for load?

2007-02-17 Thread Graham Barr
On Feb 13, 2007, at 9:18 AM, John Siracusa wrote: > On 2/13/07, Graham Barr <[EMAIL PROTECTED]> wrote: >> This could be done by adding a column_exists method to RDBO which >> would >> only return true if the named column had been loaded from the DB >> or set

Re: [RDBO] Only the first unique key is used for load?

2007-02-12 Thread Graham Barr
On Mon, February 12, 2007 5:56 pm, Jonathan Vanasco wrote: > > On Feb 12, 2007, at 3:31 PM, Ask Bjørn Hansen wrote: > >> This will solve the problem for me, but it really doesn't seem quite >> right. Having to do ->new->load is already odd too. >> >> I guess what I really want is to be able to do

Re: [RDBO] Only the first unique key is used for load?

2007-02-12 Thread Graham Barr
On Mon, February 12, 2007 9:48 am, John Siracusa wrote: > On 2/11/07, Ask Bjørn Hansen <[EMAIL PROTECTED]> wrote: >> When I run Foo::Model::User::Manager->new(username => 'ask')->load >> (speculative => 1) >> >> the generated SQL is >> >> SELECT bitcard_id, email, id, name, nomail, pass, public_pro

Re: [RDBO] Multiple foreign keys to the same table

2006-10-25 Thread Graham Barr
John Siracusa wrote: > On 10/24/06 11:45 PM, Graham Barr wrote: > > The problem is that by default RDBO creates the metadata like > > > >foreign_keys => [ > > user => { > >class => 'MyClass::User', > >key_col

[RDBO] Multiple foreign keys to the same table

2006-10-24 Thread Graham Barr
We have a few tables where we have multiple foreign keys that point to the same table. For example create table user_connections ( id int unsigned not null auto_increment primary key, from_id int unsigned not null, to_id int unsigned not null, typeenum('neighbor', 'friend'