Re: [RDBO] Two RDBO hierarchies interfering

2007-06-25 Thread Ovid
in my DB, I'm not locked into the what the loader is creating each time things get launched. Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/ -

[RDBO] Unsetting an enum value

2007-06-25 Thread Ovid
y and no server is fatal # 212.241.176.212 priority is p and reverse_name is some.url # 212.241.176.212 priority is p and reverse_name is another.url In other words, trying to set the enum to a null value fails. I've tried adding 'undef' the the column definition in my class, but th

Re: [RDBO] MySQL FK constraint breaking RDBO::Loader?

2007-06-20 Thread Ovid
n't replicate the issue. Have you thought about using mysqldump with the --no-data option? That will just dump your schema and you can run the loader against that. Or is it something a bit more involved than that? -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI

Re: [RDBO] MakeMethods::Generic.pm 'count' interface errors

2007-06-18 Thread Ovid
t1.b_id) > > But this is tested and works properly too. So what happens when you concatenate the IDs '1', '12' and '11', '2'? I think you need a separator in there: SELECT COUNT(DISTINCT t1.a_id || '-' || t1.b_id) Che

Re: [RDBO] Deleting 'one to one' object fails

2007-06-13 Thread Ovid
- Original Message From: John Siracusa <[EMAIL PROTECTED]> > This is fixed in SVN. The test you sent me now passes. Thanks! Any idea when there might be a new stable release? Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CG

Re: [RDBO] Deleting 'one to one' object fails

2007-06-12 Thread Ovid
n, so a typical build should work. Since it's a quick hack, it's rather *nix centric and assumes that you have sqlite3 installed. Let me know if there's a problem. Cheers, Ovid tar zxvf Model-undef.tar.gz [snip] cd Model-undef/ Model-undef $ perl Makefile.PL && make &am

Re: [RDBO] Deleting 'one to one' object fails

2007-06-11 Thread Ovid
ivate email if > you want). I'll see if I can get that to you tomorrow. Thanks. Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/ --

Re: [RDBO] Deleting 'one to one' object fails

2007-06-11 Thread Ovid
fore you ask :) sub has_standard_hardware { defined shift->_hardware_spec_id; } ('_hardware_spec_id' merely refers to a varchar(32) column. Nothing unusual about it) Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI -- http://us

[RDBO] Deleting 'one to one' object fails

2007-06-11 Thread Ovid
ationships" are supposed to be used when we don't have foreign keys. I've tried reading through the docs and the tests on this, but no luck. This is Rose::DB::Object 0.764. Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI -- http://users.easys

Re: [RDBO] require class

2007-06-04 Thread Ovid
s'; eval "require $classname"; if ( my $error = $@ ) { die "Could not require ($classname): $error"; } Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/

[RDBO] Datatype generator

2007-05-02 Thread Ovid
EFAULT($){ return default => shift } sub LAZY(){ return lazy=> 1 } sub NOT_NULL() { return not_null=> 1 } sub PRIMARY_KEY() { return primary_key => 1 } 1; Anyone see problems with this approach? Cheers, Ovid -- Buy the book -- http://www.orei

Re: [RDBO] One to Optional One relationships

2007-04-26 Thread Ovid
should behave. 'one to optional one' should just allow me to set up an 'optional' second class to be associated with the primary class and delete the second class, as needed. e.g., if 'A' has an optional 'B', the existence or non-existence of

[RDBO] One to Optional One relationships

2007-04-24 Thread Ovid
1 at line 311 # Server ID is at line 313 So I am assuming that I'm using 'relationships' wrong. I've tried adding 'required => 0' and 'optional => 1' to my definition, but that seems to have no affect. How can I have my s

Re: [RDBO] (wishlist) Distributed Key Support

2007-04-23 Thread Ovid
--- Ask Bjørn Hansen <[EMAIL PROTECTED]> wrote: > > On Apr 23, 2007, at 9:19, Ovid wrote: > > [mysql truncating data values] > >> Upgrade to 5.x and turn on 'STRICT MODE' or SQL STANDARD mode - > one > >> or both of those settings will fi

Re: [RDBO] (wishlist) Distributed Key Support

2007-04-23 Thread Ovid
e shown another use, but since it no longer appears to be on the Web, it's tough for me to throw that at folks :) Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/ ---

Re: [RDBO] (wishlist) Distributed Key Support

2007-04-23 Thread Ovid
hose from an old post. It appears that they are no longer there :( You can google for them "hugh darwen missing info without nulls" and get references. I'm sure it's still out there somewhere. Sorry about that. Cheers, Ovid -- Buy the book -- http://www.oreilly.

Re: [RDBO] (wishlist) Distributed Key Support

2007-04-23 Thread Ovid
f the distributed tables (at once, rather than iteratively) and return the table name if one and only one had the required data. It turns out to be tricky for me to write, though :) Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI

Re: [RDBO] (wishlist) Distributed Key Support

2007-04-23 Thread Ovid
--- John Siracusa <[EMAIL PROTECTED]> wrote: > On 4/23/07, Ovid <[EMAIL PROTECTED]> wrote: > > http://tinyurl.com/26hpwz > > What's wrong with implementing the scenario described at that URL > exactly as it's explained, by using multi-column foreign keys

[RDBO] (wishlist) Distributed Key Support

2007-04-23 Thread Ovid
key_columns => { id => 'server_id' }, }, shared => { class => 'My::Server::Dedicated', key_columns => { id => 'server_id' }, }, }

Re: [RDBO] Read-only objects

2007-04-16 Thread Ovid
cur far away from the actual code causing the error, thus making things hard to debug. Thus, I don't see much benefit. Plus, substituting a different meta class works with any database. Views, as you've pointed out, don't. Cheers, Ovid -- Buy the book -- http://www.oreilly.com/ca

[RDBO] Column "is not null"

2007-04-16 Thread Ovid
ure out from Rose is this: my $operating_systems = OS::Manager->get_os( query => [ install_vlan => { like => '%' } ], ); Is there a more correct way of doing this other than using SQL directly? Cheers, Ovid -- Buy the book -- http://www.oreilly

Re: [RDBO] dbh caching

2007-04-13 Thread Ovid
ng Test::Class). I'll have to start looking into a more permanent solution soon. I like what Peter Karman posted and may use that as a starting point. Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI -- http://u

Re: [RDBO] Read-only objects

2007-04-06 Thread Ovid
--- Jonathan Vanasco <[EMAIL PROTECTED]> wrote: > Sorry, Let me clarify: > > Ovid - you have the seed of this readonly class... john mentioned > what needs to happen for it to get rolled into rose. any chance > that might happen? I can give you a definite

Re: [RDBO] Read-only objects

2007-04-05 Thread Ovid
exceptions thrown as close to the code causing it as possible, particularly since large systems can make it very hard to find out where the offending line is. Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks

Re: [RDBO] Read-only objects

2007-04-05 Thread Ovid
;. Agreed and I have something very similar. As noted in another response, I just felt it would be good to trap this at the accessor level to ensure that fatal errors would be reported where the bad code is. Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI --

Re: [RDBO] Read-only objects

2007-04-04 Thread Ovid
--- Ovid <[EMAIL PROTECTED]> wrote: > My 'read-only' objects now have their very own metadata class. As a side note, it might be nice if a 'readonly' metadata class were natively available in Rose::DB::Object, with an optional way of allowing it to be read/wri

[RDBO] Read-only objects

2007-04-04 Thread Ovid
Donhost::OS->new( os => 'ubuntu' ); The hack guarantees that only things like the following throwing exceptions: $os->os('windows'); $os->description('sucks'); The hack relies on the order of call stack frames being different when I'm constructing an

Re: [RDBO] Overriding the metadata class

2007-04-03 Thread Ovid
--- "Randal L. Schwartz" wrote: > >>>>> "Ovid" == Ovid <[EMAIL PROTECTED]> writes: > > Ovid> Ack! A 'do nothing' elsif branch? Much cleaner: > > Nope, that changed the meaning. If I provide a value in updates, > it

Re: [RDBO] Overriding the metadata class

2007-04-03 Thread Ovid
xt if $column->is_primary_key_member; my $getter = $column->accessor_method_name; my $setter = $column->mutator_method_name; if ( exists $updates{$getter} ) { $new->$setter( $updates{$getter} ); } else { $new->$setter( $self-&g

Re: [RDBO] Overriding the metadata class

2007-04-03 Thread Ovid
ry much like to be in a position where if someone sees a property named "username", they don't know or care whether or not that's an ID and eventually, I can throw surrogate keys on the "accounts" table and no longer worry about whether or not a "username" needs

Re: [RDBO] Overriding the metadata class

2007-04-03 Thread Ovid
d to do is this: sub add_columns { my $self = shift; $self->SUPER::add_columns(@_); foreach my $column ( $self->columns ) { $self->alias_column( $column->name => $self->class->public_colum

Re: [RDBO] Overriding the metadata class

2007-04-02 Thread Ovid
$self->make_override( $method ); } The 'mutators' would return all 'set_*' type methods along with the 'update', 'delete', etc. methods. And thanks for your response. I'm really liking what I see in Rose :) Cheers, Ovid -- Buy the book -- http