Re: [RDBO] Deleting from a one-to-many

2007-02-06 Thread John Siracusa
On 2/6/07, Derek Watson [EMAIL PROTECTED] wrote: How would I go about deleting only the UK price? The following seems to delete the UK price record, but leaves it in the collection of $p-prices. my ($price) = grep { $_-region eq 'UK' } $p-prices; $price-delete; After doing that, you could

Re: [RDBO] Deleting from a one-to-many

2007-02-06 Thread John Siracusa
On 2/6/07, Derek Watson [EMAIL PROTECTED] wrote: That was pretty much my position, too -- I was looking for something more semantically appropriate. My task was trivial to solve in one or two ways, I just didn't see any examples on how to do this stuff elegantly. What I am really looking for

Re: [RDBO] some db parameter questions

2007-02-08 Thread John Siracusa
On 2/8/07 5:28 PM, Jonathan Vanasco wrote: I want them to have a DB initially. begin fetch manipulate, save commit / rollback kill db do more stuff that is read only. error out if i try to save anything ( no db ) begin set db load? manipulate commit rollback Ah, then yeah, you

Re: [RDBO] some db parameter questions

2007-02-08 Thread John Siracusa
On 2/8/07 6:10 PM, Jonathan Vanasco wrote: actually, how do you feel about this replacement routine? That looks pretty much like what I checked in after my previous reply :) (still hunting for all the $self-{'dbh'} instances...) -John

Re: [RDBO] timezone for magical 'now' value in datetime columns

2007-02-09 Thread John Siracusa
On 2/8/07, Ask Bjørn Hansen [EMAIL PROTECTED] wrote: On 2/8/07, Michael Reece [EMAIL PROTECTED] wrote: i see that i can define the column as saved_on = { type = 'datetime', time_zone = 'America/New_York' } and get the right datetime value, but is there an easy way to influence the

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). Since

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

2007-02-13 Thread John Siracusa
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 by calling the accessor method. And have -load use column_exists instead of defined when passed a

[RDBO] New Manager argument forms

2007-02-16 Thread John Siracusa
How do people feel about the following shortcuts? Manager-get_objects([ a = 1, b = 2 ]); Manager-get_objects({ a = 1, b = 2 }); Both being equivalent to: Manager-get_objects(query = [ a = 1, b = 2 ]); This is how the new find relationship method type works, and I'm wondering if

Re: [RDBO] How to use Rose::DB::Object::{Loader, Helpers} at the same time?

2007-02-17 Thread John Siracusa
On 2/16/07 9:13 PM, George Hartzell wrote: This question still stands, is there a standard way to use mixin classes w/ Loader? The usual way is to create a common base class with all the helpers you want, then tell the loader to use that class as the base_class.

Re: [RDBO] Faking row level triggers

2007-02-18 Thread John Siracusa
On 2/18/07 1:18 AM, Ask Bjørn Hansen wrote: I noticed that save() seems to call insert() or update() as appropriate. I've updated the docs in SVN to better reflect the fact that save() calls insert() or update() as appropriate, since that is part of the public API. -John

Re: [RDBO] incorrect column type for double precision?

2007-02-20 Thread John Siracusa
On 2/20/07, Michael Reece [EMAIL PROTECTED] wrote: in a postgres table, i have a column lat| double precision the column definitions spit out from $class-meta- perl_class_definition interpreted this as lat= { type = 'scalar', length = 8 }, I've added a

Re: [RDBO] Customising R:D:O:Loader generated methods

2007-02-21 Thread John Siracusa
On 2/21/07, Adrian Howard [EMAIL PROTECTED] wrote: Rose::DB::Object::Loader-new( db = MyApp::DB-new, class_prefix = 'MyApp' )-make_classes( pre_init_hook = sub { my $meta = shift; $meta-column( 'some_column' )-alias( '_some_column' )

Re: [RDBO] ANNOUNCE: Rose::DB::Object 0.761 released

2007-02-23 Thread John Siracusa
On 2/23/07 9:28 PM, Randal L. Schwartz wrote: The rules are defined in ExtUtils::MM, function parse_version. This is enough to fix it: if(${Math::BigInt::VERSION} = 1.78) Just add braces. Already fixed in SVN. (I moved the real version number for that file above that line in SVN

Re: [RDBO] Loader primary key confusion

2007-02-27 Thread John Siracusa
On 2/27/07, Fred Cox [EMAIL PROTECTED] wrote: Version 761 (latest in FreeBSD ports) RDBO::Loader chooses the wrong primary key for this PostgreSQL table: The column name year is auto-quoted (probably a reserved word) and wasn't being unquoted properly by Rose::DB. The fix is in SVN. The diff

Re: [RDBO] inflating/deflating columns using mysql functions

2007-02-28 Thread John Siracusa
On 2/28/07, Michael Reece [EMAIL PROTECTED] wrote: is it possible to inflate/deflate columns using mysql functions via RDBO? If you're feeling daring, this API is still not public, but I'm pretty sure it still works:

Re: [RDBO] safe namespace for user data in rose objects ?

2007-03-01 Thread John Siracusa
On 3/1/07 5:30 AM, Adrian Howard wrote: On 1 Mar 2007, at 00:47, Jonathan Vanasco wrote: would it be possible to reserve a namespace within rose db objects for user use? [snip] Using one of the inside-out object classes is one way around this. I use Class::BuildMethods. Or just pick a

Re: [RDBO] MySQL SET columns not checking values()?

2007-03-01 Thread John Siracusa
On 3/1/07 7:03 AM, Adrian Howard wrote: I've got some SET columns which RDBO seems to be parsing fine, since the column() values() are set okay, but it accepts things that aren't in values(). Bug? Expected behaviour? Bug, now fixed in SVN. Thanks for the report. -John

Re: [RDBO] safe namespace for user data in rose objects ?

2007-03-01 Thread John Siracusa
On 3/1/07 9:57 AM, Jonathan Vanasco wrote: i'm actually doing reverse dns now -- as there are some things i've considered submitting as patches or releasing via svn , and that made sense -- but i just thought it might make sense if theres a documented area or prefix ( even that ) for people to

Re: [RDBO] MantToMany + enum bug?

2007-03-06 Thread John Siracusa
On 3/4/07, Cory Bennett [EMAIL PROTECTED] wrote: Any ideas or work arounds? Looks like a bug. The only workaround I can think of is to use the unset_column_value_modified() function from Rose::DB::Object::Util. I'll work on a fix... -John

Re: [RDBO] [bug] Loader (for Postgresql?) picks up bad sequence names

2007-03-06 Thread John Siracusa
On 3/4/07, Randal L. Schwartz merlyn@stonehenge.com wrote: After running Loader, I got: sequence = 'foo_bar' Ug, more unquoting bugs. I'll track that down when I have a chance, thanks. -John - Take Surveys. Earn

Re: [RDBO] unexpected fetchrow_array in scalar context

2007-03-07 Thread John Siracusa
On 3/7/07, Michael Reece [EMAIL PROTECTED] wrote: this was causing me problems (always getting counts of 1) because my DBI abstraction layer re-implements fetchrow_array, only ever returning a list. Well there's your problem :) [...] For these reasons you should exercise some caution if you

Re: [RDBO] auto_prime_caches, or common custom Metadata

2007-03-08 Thread John Siracusa
On 3/8/07 7:33 PM, Michael Reece wrote: here's what i came up with: in package My::RDBO::_base, sub meta_class { 'My::RDBO::_meta' } and then, package My::RDBO::_meta; use base 'Rose::DB::Object::Metadata'; sub auto_prime_caches { 0 } is this the expected way to do this sort of

Re: [RDBO] auto_prime_caches, or common custom Metadata

2007-03-08 Thread John Siracusa
On 3/8/07 9:44 PM, [EMAIL PROTECTED] wrote: that's all fine and good until i create a table called 'metadata'. :) Distinct namespaces will avoid that. No need for name mangling. Example: My::DBObject - common base class My::DBObject::Metadata - custom metadata class My::DB::Foo -

Re: [RDBO] related objects omitted/restricted by Rose::DB::Object::Manager during query

2007-03-09 Thread John Siracusa
On 3/9/07, Jud [EMAIL PROTECTED] wrote: my $result = My::Project::Manager-get_projects ( query = [ 'employees.name' = 'jud', ], with_objects = [ 'employees' ], ); I get the expected results (1 item in the test case). However, when I look at the list of employees for

Re: [RDBO] delete_prices()

2007-03-09 Thread John Siracusa
On 3/9/07, Peter Karman [EMAIL PROTECTED] wrote: But I don't get this magical method: $product-delete_prices($price_id); which would be equivalent to: sub delete_prices { my $self = shift;# Product my $price_id = shift; my @keep = grep { $_-id ne $price_id }

Re: [RDBO] on_set trigger bug

2007-03-09 Thread John Siracusa
On 3/9/07, Cory Bennett [EMAIL PROTECTED] wrote: I think this is a bug anyway, but it could be a usage error. When using an on_set trigger, the return value from the setter is always an empty-string, but the set seems to still be working. Yep, it was a bug. Fixed in SVN. Thanks for the

Re: [RDBO] related objects omitted/restricted by Rose::DB::Object::Manager during query

2007-03-09 Thread John Siracusa
On 3/9/07, Jud Dagnall [EMAIL PROTECTED] wrote: I would expect that regardless of how the query was constructed, any results (projects) returned would be accurate, meaning that they would reflect the the state of things in the database at the time that the query was executed. But what you're

Re: [RDBO] [bug] Loader (for Postgresql?) picks up bad sequence names

2007-03-09 Thread John Siracusa
On 3/4/07, Randal L. Schwartz merlyn@stonehenge.com wrote: After running Loader, I got: sequence = 'foo_bar' but when it tried to use that to insert a record, Pg barfed. Fix was to manually edit all Loader-generated files to be: sequence = 'foo_bar' Can you post a test case for

Re: [RDBO] Beginner q. on date

2007-03-15 Thread John Siracusa
On 3/15/07 6:14 AM, Danial Pearce wrote: But if I choose the NOT NULL route, then surely I will still need a special check i.e. if ($date ne '-00-00') RDBO uses DateTime to handle it's objects I believe. YMMV but I think it may handle the -00-00 case under the hood. -00-00

Re: [RDBO] Catalyst::Plugin::Session::Store::DBI

2007-03-15 Thread John Siracusa
On 3/15/07 9:14 AM, Peter Karman wrote: The latest (0.09) CPAN version of this Catalyst plugin now contains support for RDBO. You can specify a RDBO class name as the 'dbi_dbh' config param, and it will return the dbh like: My::RDBO::Session-new-dbh Shouldn't that be this instead?

Re: [RDBO] Migration from legacy basic DBI to Rose?

2007-03-16 Thread John Siracusa
On 3/16/07, James Masters [EMAIL PROTECTED] wrote: Creation date $thing{createdate}, postcode: $thing{address}{postcode}. Yes, I know - I'm an amateur. But it will be a massive job converting all this hash methodology to a PERL OO method methodology particularly as Rose method calls don't

Re: [RDBO] set default DateTime format for stringification

2007-03-17 Thread John Siracusa
On 3/16/07 3:22 PM, Peter Karman wrote: I know how to set the default output format for a DateTime object when it is stringified. I'm struggling to know where best to set that for my DateTime-type columns. Do I create my own Metadata Column subclass and do it there? Or is there some other

Re: [RDBO] Debian Rose

2007-03-19 Thread John Siracusa
On 3/17/07, Jeff Chimene [EMAIL PROTECTED] wrote: I see that Rose hasn't been Debianized. Is this deliberate or has no Deb developer filed an ITP? It's certainly not deliberate. I don't use Debian, but if anyone wants to Debianize RDBO, I'll answer any questions I can... -John

Re: [RDBO] Debian Rose

2007-03-19 Thread John Siracusa
On 3/19/07, Jeff Chimene [EMAIL PROTECTED] wrote: BTW, kudos for the make_modules() it did good job on a MySQL schema. I couldn't get make_classes() to work, though. From the tutorial @classes = $loader-make_classes; foreach my $class (@classes) { if($class-isa('Rose::DB::Object'))

Re: [RDBO] Sequence Support

2007-03-20 Thread John Siracusa
On 3/20/07, Derek Watson [EMAIL PROTECTED] wrote: Is it possible to get sequence support in RDBO? I know that sequences are supported for primary key generation, but I have a few cases where they are used for non-keyed columns What would this support look like? How would the sequence be

Re: [RDBO] Sequence Support

2007-03-20 Thread John Siracusa
On 3/20/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: I'd actually like to see sequence classes Rose::DB::Object::Metadata::Sequence Which lets us map sequences to rose objects , and vice versa I'd like to be able to call my $seq= MyApp::Rose::DB::Object::Sequence1-new();

Re: [RDBO] Column.pm bug w/patch

2007-03-23 Thread John Siracusa
On 3/10/07, Cory Bennett [EMAIL PROTECTED] wrote: I have a column with inflate/deflate triggers and sometimes I get this error: Not an ARRAY reference at ./Rose/DB/Object/Metadata/Column.pm line 1087 Sorry for the delay. Your patch is applied to SVN. Thanks! -John

Re: [RDBO] Duplicate many-to-many map rows

2007-03-23 Thread John Siracusa
On 3/10/07, Mike Schilli [EMAIL PROTECTED] wrote: $foo-add_bars({ string = I am Bar }); $foo-save(); The first time this is run, records for both I am Foo in foos and I am Bar in bars are created [...] and the relationship table contains the mapping: mysql select * from

Re: [RDBO] Using the results of make_methods()

2007-03-26 Thread John Siracusa
On 3/23/07, Jeff Chimene [EMAIL PROTECTED] wrote: How do I eliminate the following error message? $ perl ./fred.pl Subroutine init_db redefined at inspectDB/DB/Object/AutoBase1.pm line 7. AutoBaseNNN.pm classes are the automatically generated RDBO base classes created by the Loader. How is

Re: [RDBO] Paging with Iterators

2007-03-26 Thread John Siracusa
On 3/24/07, Randal L. Schwartz merlyn@stonehenge.com wrote: rose == rose [EMAIL PROTECTED] writes: rose I'm using Rose with a fairly large MySQL database and using an rose iterator like rose my $itr = Bar-get_bars_iterator(); rose while($itr-next()) { rose won't work because by

Re: [RDBO] Using the results of make_methods()

2007-03-26 Thread John Siracusa
On 3/26/07, Jeff Chimene [EMAIL PROTECTED] wrote: make_classes(); sub make_classes { use base qw(Rose::DB Rose::DB::Object::Loader); You do not need to inherit from Rose::DB::Object::Loader. Loader is a standalone class that can do work for you. It's not part of any

Re: [RDBO] Does build_select() Support the offset argument?

2007-03-27 Thread John Siracusa
On 3/27/07, Robert James Kaes [EMAIL PROTECTED] wrote: My reading of the Rose::DB::Object::QueryBuilder documentation is that build_select() does NOT support the offset argument like the get_objects() manager method. Is this an oversight, or is there a fundamental reason why build_select()

Re: [RDBO] Defining Some times Relationships

2007-03-27 Thread John Siracusa
On 3/27/07, Robert James Kaes [EMAIL PROTECTED] wrote: CREATE TABLE locations ( id INT, ...); CREATE TABLE companies ( id INT, location_id INT NOT NULL REFERENCES locations(id), ...); CREATE TABLE exhibitions (

Re: [RDBO] Rose::DB::Loader (aka feeling dim)

2007-03-28 Thread John Siracusa
On 3/28/07, Adrian Howard [EMAIL PROTECTED] wrote: CREATE TABLE products ( id SERIAL NOT NULL PRIMARY KEY, nameVARCHAR(255) NOT NULL, vendor_id INT REFERENCES vendors (id), UNIQUE(name) ) TYPE = InnoDB; While it will happily accept

Re: [RDBO] Best way to do multiple calls to database

2007-03-29 Thread John Siracusa
On 3/29/07 6:27 AM, James Masters wrote: So now $products is an array of all product information, just like %product was a hash of all product info. But how do I elegantly get that stock quantity info for a particular location out of the $products array? I need something like: foreach

Re: [RDBO] Loader: request and doc change

2007-04-02 Thread John Siracusa
On 4/2/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: doc change: with_managers seems to default to true , it should be listed as such It is. File: lib/Rose/DB/Object/Loader.pm ... =item Bwith_managers BOOL If true, create LRose::DB::Object::Manager|Rose::DB::Object::Manager-derived

Re: [RDBO] Overriding the metadata class

2007-04-02 Thread John Siracusa
On 4/2/07, [EMAIL PROTECTED] wrote: sub setup { my ( $self, %arg_for ) = @_; $self-SUPER::setup(%arg_for); foreach my $column ( $self-columns ) { my $name = $column-name; # here's the problem $self-alias_column( $name = _$name )

Re: [RDBO] Overriding the metadata class

2007-04-02 Thread John Siracusa
On 4/2/07, Ovid [EMAIL PROTECTED] wrote: I didn't see it in the docs, but is there anything akin to 'mutator' metadata which would let me do something like the following? foreach my $method ( $class-mutators ) { $self-make_override( $method ); } The 'mutators' would return all

Re: [RDBO] Overriding the metadata class

2007-04-03 Thread John Siracusa
On 4/3/07 5:31 AM, Ovid wrote: One problem is that the return value of add_columns() is actually the new number of columns in the 'columns_ordered' attribute, not the columns themselves Doh! Fixed in SVN. To be fair, I'm going to have to alter even this. I've realized that I'm making my

Re: [RDBO] Overriding the metadata class

2007-04-03 Thread John Siracusa
On 4/3/07, Ovid [EMAIL PROTECTED] wrote: What we're trying to do is use an ORM to make it easy to pull all database knowledge into a given layer and actually expose *very* little of structure, just the functionality. However, because surrogate (non-identifying) keys are rarely used, I have to

Re: [RDBO] Overriding the metadata class

2007-04-03 Thread John Siracusa
On 4/3/07, Randal L. Schwartz merlyn@stonehenge.com wrote: sub make_clone { ## clone the object except for primary keys and new items my $self = shift; my %updates = @_; my $new = (ref $self)-new; for my $column ($new-meta-columns) { my $getter =

Re: [RDBO] Read-only objects

2007-04-04 Thread John Siracusa
On 4/4/07 12:37 PM, Adrian Howard wrote: Since there are at least three folk who have wanted this sort of functionality - would it be worth adding something like is_initialising() to Rose::DB::Object::Util? Just to prevent gratuitous wheel reinvention :-) No, since that'd require extra

Re: [RDBO] Read-only objects

2007-04-06 Thread John Siracusa
On 4/5/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: Any chance of these features being pushed back into rose? The first thing you're likely to see is support for triggers on save, insert, update, and delete because overriding some of those correctly (handling transactions and so on) takes some

Re: [RDBO] dbh caching

2007-04-12 Thread John Siracusa
On 4/12/07 10:11 PM, Bill Moseley wrote: Ok, I just have to ask. What are people doing for dbh caching? I know this comes up often: http://thread.gmane.org/gmane.comp.lang.perl.modules.dbi.rose-db-object/1138/f ocus=1140 [...] I'm also still trying to understand the point of a new dbh

Re: [RDBO] dbh caching

2007-04-13 Thread John Siracusa
On 4/13/07, Ovid [EMAIL PROTECTED] wrote: --- Bill Moseley [EMAIL PROTECTED] wrote: I would expect that most applications need a shared dbh -- anything that uses transactions, of course. And, therefore perhaps there was a standard approach. You know, I was rather surprised about that myself.

Re: [RDBO] using functions

2007-04-15 Thread John Siracusa
On 4/14/07 1:16 AM, Jonathan Vanasco wrote: is there a way to get Rose to search based on functions? ie: bad SELECT * FROM useraccount WHERE email = ? good SELECT * FROM useraccount WHERE lower(email) = lower(?) See this thread for some earlier discussion on this topic:

Re: [RDBO] 4 key map table advice sought

2007-04-16 Thread John Siracusa
On 4/16/07 10:02 AM, Jonathan Vanasco wrote: MyRose::Object::Product relationships = [ colors = { type= 'many to many', map_class = 'MyRose::Object:: Product2Color', map_from = 'product_id', map_to = 'color_id',

Re: [RDBO] Column is not null

2007-04-16 Thread John Siracusa
On 4/16/07 10:26 AM, Ovid wrote: I can't find this in the docs, but I'm wondering how I go about an 'is not null' search. query = [ '!install_vlan' = undef ], http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/QueryBuilder.p m#query The example below should work too, but

Re: [RDBO] object caching functionality

2007-04-16 Thread John Siracusa
On 4/16/07 12:07 PM, Jonathan Vanasco wrote: i'm thinking of the following naming scheme: Helpers::object_as_yaml Helpers::init_with_yaml_object ( using the term 'object' as it is a deep 'loaded related' object, not a flat column/pairs ) How about object_tree instead of just object to

Re: [RDBO] object caching functionality

2007-04-16 Thread John Siracusa
On 4/16/07 12:22 PM, John Siracusa wrote: How about object_tree instead of just object to better indicate that input/output isn't just a long object: ^ Er, lone -John - This SF.net email

Re: [RDBO] object caching functionality

2007-04-17 Thread John Siracusa
On 4/17/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: i've also started playing around with something that will make you cringe, or perhaps chime in with suggestions and enthusiasm ! object_tree_as_storable object_tree_from_storable right now they're being made traverse the

Re: [RDBO] object caching functionality

2007-04-18 Thread John Siracusa
On 4/17/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: Though that can be handled using a strip helper alone too -- we'd just need an unstrip() function that builds back in a db object and metadata I don't think that'd be necessary. The meta and db attributes would re-materialize on demand.

Re: [RDBO] dbh caching

2007-04-19 Thread John Siracusa
On 4/18/07, Bill Moseley [EMAIL PROTECTED] wrote: This works fine in my base class: sub init_db { our $DBH =|| App::RDB-new } I've got the same $dbh for the life of the program. But, I'd like to try using DBI-connect_cached directly. What's your goal? Do you still want just one $dbh

Re: [RDBO] dbh caching

2007-04-19 Thread John Siracusa
On 4/19/07, Bill Moseley [EMAIL PROTECTED] wrote: On Thu, Apr 19, 2007 at 10:35:16AM -0400, John Siracusa wrote: On 4/18/07, Bill Moseley [EMAIL PROTECTED] wrote: This works fine in my base class: sub init_db { our $DBH =|| App::RDB-new } I've got the same $dbh for the life of the program

Re: [RDBO] Scratchpad Space in RDBOs???

2007-04-19 Thread John Siracusa
On 4/19/07, Jeffrey Horn [EMAIL PROTECTED] wrote: Is there a place in an RDBO that I can use to stash this sort of information that isn't supposed to get sent to the db on a save? How could I make such a scratchpad space myself? There's no official place, but as long as you don't squish any

Re: [RDBO] dbh caching

2007-04-19 Thread John Siracusa
Given this code: package A; use base 'Rose::DB::Object'; __PACKAGE__-meta-setup(table = 't1', columns = [ qw(id a) ]); our $DB; sub init_db { my $dbh = DBI-connect_cached('DBI:mysql:test', 'root'); return $DB = Rose::DB-new(driver = 'mysql', dbh = $dbh) unless($DB);

Re: [RDBO] dbh caching

2007-04-20 Thread John Siracusa
On 4/20/07, Bill Moseley [EMAIL PROTECTED] wrote: On Thu, Apr 19, 2007 at 04:59:18PM -0400, John Siracusa wrote: The full DBI trace output is included below. I don't see multiple disconnects (or any disconnects, really) in the output, so I'm pretty sure it's only using one $dbh. It's

Re: [RDBO] Bizarre. New PC. Everything faster except Rose which is 5X slower!

2007-04-20 Thread John Siracusa
On 4/20/07, James Masters [EMAIL PROTECTED] wrote: I just can't imagine what's going on here. Thanks for any pointers, Have you tried running the modules on the old machine but pointing them to the MySQL db on the new machine? That might help narrow it down... -John

Re: [RDBO] Bizarre. New PC. Everything faster except Rose which is5X slower!

2007-04-20 Thread John Siracusa
On 4/20/07, James Masters [EMAIL PROTECTED] wrote: how can I see exactly what select statement Rose is doing? Either turn on DBI-trace(...) or set these variables: $Rose::DB::Object::Debug = 1; $Rose::DB::Object::Manager::Debug = 1; The DBI approach is probably better, but also

Re: [RDBO] Bizarre. New PC. Everything faster except Rose whichis5Xslower!

2007-04-21 Thread John Siracusa
On 4/21/07 6:20 PM, James Masters wrote: It appears that the login is the problem. But...if my test program uses a straight DBI/DBD call and Rose is not used at all, then there is no login delay. It only happens when I login via Rose. Have you counted how many times you connect to the

Re: [RDBO] Rose::DB::Object::Manager logic for FKs and with_objects

2007-04-23 Thread John Siracusa
On 4/23/07, Ethan Rowe [EMAIL PROTECTED] wrote: Table b has an FK to table a. Table b also has an FK to table c. These FK columns are all NOT NULL constrained. If that is the case, and if referential integrity is turned on for the foreign key that links b to c, then you are telling RDBO that

Re: [RDBO] (wishlist) Distributed Key Support

2007-04-23 Thread John Siracusa
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 and a check constraint on the subtype table(s)? A simple syntax could be: distributed_keys =

Re: [RDBO] (wishlist) Distributed Key Support

2007-04-23 Thread John Siracusa
On 4/23/07, Ovid [EMAIL PROTECTED] wrote: --- 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 and a check

Re: [RDBO] Rose::DB::Object::Manager logic for FKs and with_objects

2007-04-23 Thread John Siracusa
On 4/23/07, Ethan Rowe [EMAIL PROTECTED] wrote: Table b has an FK to table a. Table b also has an FK to table c. These FK columns are all NOT NULL constrained. If that is the case, and if referential integrity is turned on for the foreign key that links b to c, then you are telling RDBO that

Re: [RDBO] Rose::DB::Object::Manager logic for FKs and with_objects

2007-04-23 Thread John Siracusa
On 4/23/07, Ethan Rowe [EMAIL PROTECTED] wrote: John Siracusa wrote: Yes, thanks. It's supposed to be doing what you expect it to do, but it's not doing it due to a bug. I'll think about the best way to fix it. I could of course just remove the optimization, but I have a few other ideas

Re: [RDBO] One to Optional One relationships

2007-04-24 Thread John Siracusa
On 4/24/07 11:50 AM, Ovid wrote: I have a 'server' object. There's a 'suspension' table which has an optional single record for each server. If a server is suspended, the table gets a record of metadata for why the server was suspended. When the server is unsuspended, we delete said record.

[RDBO] Delays

2007-04-27 Thread John Siracusa
Sorry for any delays in responding to RDBO issues or email. We just had a baby (our second) and things will likely be a bit hectic here for a while... :) -John - This SF.net email is sponsored by DB2 Express Download DB2

Re: [RDBO] Delays

2007-04-27 Thread John Siracusa
Thanks to all. Incidentally, Rose was one of my name choices for her, but my wife nixed it :) -John - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control

Re: [RDBO] Release soon

2007-05-01 Thread John Siracusa
On 5/1/07, Derek Watson [EMAIL PROTECTED] wrote: I feel like I'm repeating work here -- I've got a similar set of functions that serialize and restore trees of objects, only I'm doing this in a very specific way, keeping only what I want from specific classes (not reusable). What are the

Re: [RDBO] Datatype generator

2007-05-02 Thread John Siracusa
On 5/2/07, Ovid [EMAIL PROTECTED] wrote: This may or may not be of use to anyone. One thing I've done is create a 'datatype generator' which is shorthand for many data types and it's legible, too. For example, instead of this: reason = { type = 'scalar', length = 255,

[RDBO] ANNOUNCE: Rose::DB::Object 0.764 released

2007-05-04 Thread John Siracusa
(05.04.2007) - John Siracusa [EMAIL PROTECTED] * Added a find method type to many-to-many relationships. * Added a count method type to ...-to-many relationships. * Added support for nested joins. * The setup() method now supports a helpers shortcut for importing methods from

Re: [RDBO] auto-generate POD just like class definitions

2007-05-11 Thread John Siracusa
On 5/10/07, Peter Karman [EMAIL PROTECTED] wrote: What I would like to do now is at the same time I create code, also create stub POD for each of the columns, fks and relationship methods that are magically available in each class. Just stubs: the method name, column/fk/relationship

Re: [RDBO] Relationship with complex mapping

2007-05-11 Thread John Siracusa
On 5/11/07, Michael Lackhoff [EMAIL PROTECTED] wrote: I had to change a relationship from a simple ID to ID relationship to one that also includes a second ID. Worse still the second ID is not a column in one of the relationship partners but has to be taken from a record two steps up the

Re: [RDBO] re-using relationships with extra conditions

2007-05-11 Thread John Siracusa
On 5/11/07, Michael Reece [EMAIL PROTECTED] wrote: 1. is there a way to pull that off with 'one to one' type relationship so i can drop the subroutine? Not unless you add an is_latest column or something to the table. 2. or is there a way to tack on extra conditions (or custom ordering) to

Re: [RDBO] MySQL Nullable Integer Attributes Return 0 when they should return undef (Rose::DB 0.734 / RDBO 0.764)

2007-05-16 Thread John Siracusa
On 5/16/07 12:51 AM, Jeffrey Horn wrote: __PACKAGE__-meta-setup( table = 'foo', columns = [ foo_id = { type = 'bigint', not_null = 1 }, nullable_int = { type = 'bigint' }, nullable_varchar = { type = 'varchar', length = 10 }, ],

Re: [RDBO] small bug in use_key

2007-05-17 Thread John Siracusa
On 5/17/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: if you use_key on the primary key, rose doesn't do anything. Fixed in SVN. Thanks for the report. -John - This SF.net email is sponsored by DB2 Express Download DB2

Re: [RDBO] Short cut for setting map records data

2007-05-17 Thread John Siracusa
On 5/17/07, Derek Watson [EMAIL PROTECTED] wrote: I have gone down a similar path before, http://www.mail-archive.com/rose-db-object@lists.sourceforge.net/msg01792.html Yeah, I was about to post that link. Thanks :) When you need to manipulate the map records themselves, setup an

[RDBO] ANNOUNCE: Rose::Object 0.84 released

2007-05-17 Thread John Siracusa
Yes, Rose::Object. It had a bug that prevented Rose::DB::Object's new helpers setup() parameter from working. Rose::DB::Object 0.765 will require Rose::Object 0.84 or later once it's released, but you should upgrade to Rose::Object 0.84 right now if you want the helpers setup param to work with

Re: [RDBO] Nested many-to-many

2007-05-17 Thread John Siracusa
Can you also post the table definitions? (Simplified, if necessary.) On 5/17/07 5:19 PM, Wiggins d'Anconia wrote: 'company_branches' stores a one-to-many of companies to their branches. 'user_company_map' stores what I thought would originally be a many-to-many between the users and the

Re: [RDBO] Streamlining documentation

2007-05-18 Thread John Siracusa
On 5/18/07, Marvin Humphrey [EMAIL PROTECTED] wrote: On May 18, 2007, at 9:00 AM, John Siracusa wrote: Since those sections are clearly labeled and there are links to all the major sections (in the HTML version of the POD, that is), I don't think it's too onerous for those people that want

Re: [RDBO] Streamlining documentation

2007-05-18 Thread John Siracusa
On 5/18/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: John- Maybe you could do a callout for recipes, and then cull the best into it? It's on the list, but not at the top just yet. (Even just collecting and editing recipes takes time.) If someone else wants to head this up, let me know. The

Re: [RDBO] Streamlining documentation

2007-05-18 Thread John Siracusa
On 5/18/07, Derek Watson [EMAIL PROTECTED] wrote: It's on the list, but not at the top just yet. (Even just collecting and editing recipes takes time.) If someone else wants to head this up, let me know. Is there a Wiki installed somewhere we can start working on in an ad-hoc fashion?

Re: [RDBO] Streamlining documentation

2007-05-19 Thread John Siracusa
On 5/19/07 1:01 PM, Adrian Howard wrote: A quick start along the lines of Here's a database schema. Here's RDBO::Loader.. Bish bosh. Job done. Oh yes, when you need some more flexibility, better validation, etc. here's where to look would be nice. The quick-start guide I envision has very

Re: [RDBO] Streamlining documentation

2007-05-20 Thread John Siracusa
On 5/20/07 10:02 AM, Adrian Howard wrote: On 20 May 2007, at 00:15, John Siracusa wrote: The quick-start guide I envision [...] That sounds excellent :-) Thank you. Don't thank me for envisioning it; save it for when I actually get around to writing it ;) -John

Re: [RDBO] make methods error

2007-05-22 Thread John Siracusa
On 5/22/07, James Masters [EMAIL PROTECTED] wrote: This problem has gone away now. I don't understand why but I *think* what did it was that I indexed (unique) the column concerned in the target MyISAM table. Do key columns need to be indexed? RDBO has no idea if your columns are indexed or

[RDBO] Namespace for 3rd-party RDBO modules

2007-05-23 Thread John Siracusa
Does anyone have any good ideas for a namespace for module that augment or extend RDBO, but that are not part of the official RDBO distribution? The first thing that springs to my mind is: Rose::DBx::* That'd be for both modules that are related to Rose::DB and modules that are related to

Re: [RDBO] Namespace for 3rd-party RDBO modules

2007-05-23 Thread John Siracusa
On 5/23/07 12:53 PM, Jonathan Vanasco wrote: On May 23, 2007, at 9:36 AM, John Siracusa wrote: Does anyone have any good ideas for a namespace for module that augment or extend RDBO, but that are not part of the official RDBO distribution? The first thing that springs to my mind is: Rose

Re: [RDBO] setting default_update_changes_only

2007-05-23 Thread John Siracusa
On 5/23/07 1:49 PM, mla wrote: I noticed that omitting the override_existing does not raise an exception; the redefinition is just ignored. Is that expected? Yes, because you'renot overriding an existing sub. MyApp::DB::Object::Metadata has no existing default_update_changes_only()

Re: [RDBO] Unable to query using sub-tablename

2007-05-24 Thread John Siracusa
On 5/24/07, James Masters [EMAIL PROTECTED] wrote: Query is combined viz: prodcode = {'like' = %shp%} productlocs.loccode = {'like' = %mtg%} Status = {'ne' = P} with_objects = productlocs [...] # category.name and categories.name would work too, since # table and relationship names are

Re: [RDBO] html and DB and Rose

2007-05-25 Thread John Siracusa
On 5/25/07, James Masters [EMAIL PROTECTED] wrote: When I asked can I put the metadata of a DB column into an HTML Object somehow and it would automatically create the appropriate html form element, you said: [...] So does this mean that the answer is no but instead I can define my own HTML

<    1   2   3   4   5   6   >