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 Jonathan Vanasco
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 > > $object_class->load(key1 => $value, key2 => $value2) > > an

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

2007-02-12 Thread Ask Bjørn Hansen
On Feb 12, 2007, at 12:20 PM, John Siracusa wrote: > $o->load(key => '...'); 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 $object_class->load(key1 => $value, ke

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

2007-02-12 Thread John Siracusa
On 2/12/07, Jud <[EMAIL PROTECTED]> wrote: >> Allowing a key name to be specified as a parameter to the load() call >> is a better idea, I think. (That'd require people to give their >> unique keys nice/sensible/memorable names, of course.) > > +1 for this. In SVN: $o->load(key => '...'); w

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

2007-02-12 Thread Jud
> Allowing a key name to be specified as a parameter to the load() call > is a better idea, I think. (That'd require people to give their > unique keys nice/sensible/memorable names, of course.) +1 for this. - Using Tomcat b

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

2007-02-12 Thread John Siracusa
On 2/12/07, Graham Barr <[EMAIL PROTECTED]> wrote: > On Mon, February 12, 2007 9:48 am, John Siracusa wrote: >> On 2/11/07, Ask Bjørn Hansen <[EMAIL PROTECTED]> wrote: >> RDBO uses the first unique key what has a defined value (evaluated in the >> order they were added to the metadata, IIRC). Sinc

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] Only the first unique key is used for load?

2007-02-12 Thread John Siracusa
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_profile, > username FROM users WHERE email = ? - bind params: > > (

Re: [RDBO] multiple $obj->add_foo() statements

2007-02-12 Thread John Siracusa
On 2/12/07, Ask Bjørn Hansen <[EMAIL PROTECTED]> wrote: > If I instead of > > $p->add_prices > ({ price => 7.89, region => 'DE' }, > { price => 1.11, region => 'JP' }); > > $p->save; > > do > > $p->add_prices({ price => 7.89, region => 'DE' });, > $p->add_pric

Re: [RDBO] looks_like_map_table

2007-02-12 Thread John Siracusa
On 2/10/07, Ask Bjørn Hansen <[EMAIL PROTECTED]> wrote: > I suggest changing the looks_like_map_table to not match "foo_bars", > but only *_map and "foos_bars". I realize we can just override it in > our convention manager, but it's a goofy default, I think. Either I > don't understand entirely

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

2007-02-12 Thread Randal L. Schwartz
> "Randal" == Randal L Schwartz writes: > "Ask" == Ask Bjørn Hansen <[EMAIL PROTECTED]> writes: Ask> unique_keys => [ Ask> [ 'email' ], Ask> [ 'username' ], Ask> ], Randal> If I recall, this maps to calling something like: Randal>$meta->unique_keys('email'); Randal>$meta->unique

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

2007-02-12 Thread Randal L. Schwartz
> "Ask" == Ask Bjørn Hansen <[EMAIL PROTECTED]> writes: Ask>unique_keys => [ Ask> [ 'email' ], Ask> [ 'username' ], Ask>], If I recall, this maps to calling something like: $meta->unique_keys('email'); $meta->unique_keys('username'); The second is probably ignored b