Re: [RDBO] rose-db-object

2007-12-27 Thread John Siracusa
Sorry about that, guys. I mis-clicked in the admin interface when trying to discard this list spam. -John - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdm

Re: [RDBO] Rose::DB::Object - load() should not depend upon sth->rows()

2007-08-10 Thread John Siracusa
On 8/10/07 11:38 AM, news wrote: > I believe it is impossible to use rows() after a single fetch() to > determine whether no not the fetch() returned a row. > > The return value from fetch() when defined does: Yeah, that's much better, thanks. Changed in SVN. -John --

Re: [RDBO] Rose::DB::Object - load() should not depend upon sth->rows()

2007-08-10 Thread news
Unfortunately, yes, rows() certainly can and will be greater than zero for the last fetch() when one or more rows are returned since it is reporting how many rows where fetched overall by the database query, not the last DBI call. I believe it is impossible to use rows() after a single fetch()

Re: [RDBO] Rose::DB::Object - load() should not depend upon sth->rows()

2007-08-08 Thread John Siracusa
On 8/8/07 10:55 AM, Philip Dye wrote: > $rv = $sth->rows; > > Returns the number of rows affected by the last row affecting > command, or -1 if the number of rows is not known or not available. In SVN, I changed in from: if($rows > 0) to if($rows > 0 || $rows == -1) which

Re: [RDBO] Rose::DB::Object::Column::Serialize?

2007-06-22 Thread John Siracusa
On 6/22/07, Svilen Ivanov <[EMAIL PROTECTED]> wrote: > This serialized columns seem common practice (at least 2-3 devs asked > up till now) but inclusion in RDBO package may be overkill, how about > posting the samples in documentation or in the wiki (I faintly recall > RDBO wiki somewhere)? There

Re: [RDBO] Rose::DB::Object::Column::Serialize?

2007-06-21 Thread Svilen Ivanov
This serialized columns seem common practice (at least 2-3 devs asked up till now) but inclusion in RDBO package may be overkill, how about posting the samples in documentation or in the wiki (I faintly recall RDBO wiki somewhere)? 2007/6/22, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > thanks aga

Re: [RDBO] Rose::DB::Object::Column::Serialize?

2007-06-21 Thread mreece
> thanks again for this, svilen. > > i took what you posted, plus the followups from jsiracusa, and got > something going. your code was very helpful. > > i made some slight adjustments, notably calling $class->freeze/thaw > in the methodmaker, and implementing those as class methods there. > > th

Re: [RDBO] Rose::DB::Object::Column::Serialize?

2007-06-21 Thread Michael Reece
thanks again for this, svilen. i took what you posted, plus the followups from jsiracusa, and got something going. your code was very helpful. i made some slight adjustments, notably calling $class->freeze/thaw in the methodmaker, and implementing those as class methods there. that allowed

Re: [RDBO] Rose::DB::Object::Column::Serialize?

2007-06-19 Thread Svilen Ivanov
Michael, Check this thread: http://www.mail-archive.com/rose-db-object@lists.sourceforge.net/msg00260.html I hope that helps 2007/6/20, Michael Reece <[EMAIL PROTECTED]>: > > i am looking to freeze/thaw (or yaml, doesn't really matter..) > unblessed data structures into a mysql column. > > has a

Re: [RDBO] Rose::DB::Object::Loader question

2007-06-04 Thread John Siracusa
On 6/4/07, Iļja Ketris <[EMAIL PROTECTED]> wrote: > On 6/4/07, John Siracusa <[EMAIL PROTECTED]> wrote: >> If it's there's a real foreign key constraint in the database, the Loader >> make a foreign key in the RDBO class. > > How is this possible? SQLite doesn't support foreign keys It does, sort

Re: [RDBO] Rose::DB::Object::Loader question

2007-06-03 Thread Iļja Ketris
On 6/4/07, John Siracusa <[EMAIL PROTECTED]> wrote: On 6/3/07 5:20 PM, I?ja Ketris wrote: > I wonder how the module decides about foreign keys over relationships. If it's there's a real foreign key constraint in the database, the Loader make a foreign key in the RDBO class. How is this poss

Re: [RDBO] Rose::DB::Object::Loader question

2007-06-03 Thread John Siracusa
On 6/3/07 5:20 PM, I?ja Ketris wrote: > I wonder how the module decides about foreign keys over relationships. If it's there's a real foreign key constraint in the database, the Loader make a foreign key in the RDBO class. -John -

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

2007-04-25 Thread Ethan Rowe
John Siracusa wrote: > Okay, this should be fixed now in SVN. Eligible (according to the > metadata) outer joins are still transformed, but now they're changed > into nested inner joins, which preserves the meaning of the query. If > nested joins are unavailable or disabled, it falls back to a bu

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 i

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

2007-04-23 Thread Ethan Rowe
John Siracusa wrote: >> Doesn't putting 'b' in the 'with_objects' set make 'b' records desired >> -- but, critically, optional -- for the query result? In which case, >> while the behaviors regarding foreign keys with full referential >> integrity enabled are appropriate in determining what 'b' r

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 tell

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

2007-04-23 Thread Ethan Rowe
Thanks for the timely response. >> 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: > 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 tha

Re: [RDBO] Rose::DB::Object and table inheritance

2007-02-13 Thread Randal L. Schwartz
> "Jonathan" == Jonathan Vanasco <[EMAIL PROTECTED]> writes: Jonathan> FWIW, i dropped using table inheritance in postgres. the way it was Jonathan> internally handled wasn't fast enough - no matter how i keyed and Jonathan> indexed the tables or tried to influence the optimizer, the inte

Re: [RDBO] Rose::DB::Object and table inheritance

2007-02-13 Thread Jonathan Vanasco
On Feb 13, 2007, at 10:29 AM, Pascal Damian wrote: > Hi all, > > Has anyone worked with Rose::DB::Object and PostgreSQL's table > inheritance? For example: > > CREATE TABLE party (id INT PRIMARY KEY, birthday DATE); > CREATE TABLE person INHERITS party (firstname TEXT, lastname TEXT); > CREA

Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-29 Thread John Siracusa
On 11/29/06, George Hartzell <[EMAIL PROTECTED]> wrote: > John Siracusa writes: > > Too late! It's in SVN now :) > > No fair. You cheated :) Too late! It's released! :) -John - Take Surveys. Earn Cash. Influence the

Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-29 Thread George Hartzell
John Siracusa writes: > On 11/28/06, George Hartzell <[EMAIL PROTECTED]> wrote: > > John Siracusa writes: > >> [...] > >> All of that said, adding iterator options to get_objects_from_sql() > >> and make_manager_method_from_sql() is pretty simple. If you really > >> want it, I'll throw it in

Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-29 Thread John Siracusa
On 11/28/06, George Hartzell <[EMAIL PROTECTED]> wrote: > John Siracusa writes: >> [...] >> All of that said, adding iterator options to get_objects_from_sql() >> and make_manager_method_from_sql() is pretty simple. If you really >> want it, I'll throw it in the next release :) > > It'd help a bun

Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread George Hartzell
John Siracusa writes: > [...] > All of that said, adding iterator options to get_objects_from_sql() > and make_manager_method_from_sql() is pretty simple. If you really > want it, I'll throw it in the next release :) It'd help a bunch. I may take a stab at it, but if you get it going, I'd lo

Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread Michael Reece
All of that said, adding iterator options to get_objects_from_sql() and make_manager_method_from_sql() is pretty simple. If you really want it, I'll throw it in the next release :) yes, please! On Nov 28, 2006, at 1:33 PM, John Siracusa wrote: On 11/28/06, George Hartzell <[EMAIL PROTECTED]>

Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread John Siracusa
On 11/28/06, George Hartzell <[EMAIL PROTECTED]> wrote: > It looks like I might be able to figure out how to get RDO::Manager to > express the query, but it would be quicker (at least as a first cut to > be able to do something like > > Foo::DB::Moose::Manager->get_iterator_from_sql(blahblahblah)

Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread George Hartzell
George Hartzell writes: > > Hi All [and John], > > [...] > It looks like I might be able to figure out how to get RDO::Manager to > express the query, but it would be quicker (at least as a first cut to > be able to do something like > > Foo::DB::Moose::Manager->get_iterator_from_sql(

Re: [RDBO] Rose::DB::Object V 0.722 && Clone::PP

2006-06-18 Thread John Siracusa
On 6/18/06 9:32 PM, Ron Savage wrote: > I notice in the Changes file for that version that Clone::PP was removed. > > And yet in META.yml for Rose::HTML::Objects it is still a requirement. > > Is the latter META file out-of-date or is the plan to remove Clone::PP from > Rose::HTML::Objects, or ..

Re: [RDBO] Rose::DB::Object subclass instances within Safe compartment

2006-06-08 Thread John Siracusa
On 6/6/06, Svilen Ivanov <[EMAIL PROTECTED]> wrote: > John, would you resend your answer to the mailing list again? Probably > you replied to Ethan directly... My entire reply is already quoted below. -John > 2006/6/6, Ethan Rowe <[EMAIL PROTECTED]>: >> John Siracusa wrote: >>> If related object

Re: [RDBO] Rose::DB::Object subclass instances within Safe compartment

2006-06-08 Thread Svilen Ivanov
John, would you resend your answer to the mailing list again? Probably you replied to Ethan directly... 2006/6/6, Ethan Rowe <[EMAIL PROTECTED]>: > John Siracusa wrote: > > > If related objects are fetched by the Manager due to require_objects > > or with_objects parameters, they should be attache

Re: [RDBO] Rose::DB::Object subclass instances within Safe compartment

2006-06-07 Thread John Siracusa
On 6/6/06, Ethan Rowe <[EMAIL PROTECTED]> wrote: > I can pass an instance of a Rose::DB::Object subclass into a Safe compartment. > The column accessor methods will work within the compartment. But accessing > "child" objects through the appropriate method breaks, because the object > instance app

Re: [RDBO] Rose::DB::Object::QueryBuilder set operations

2006-06-06 Thread John Siracusa
On 6/7/06 12:08 AM, John Siracusa wrote: >> I do intend to work with subqueries and am thinking about how to incorporate >> them or else cheat with some post-processing. > > You may have to cheat for now since QueryBuilder has no support for > subqueries (other than as liter SQL clauses) Er, make

Re: [RDBO] Rose::DB::Object::QueryBuilder set operations

2006-06-06 Thread John Siracusa
On 6/6/06 10:49 PM, Perrin Harkins wrote: > According to the docs, 'COLUMN' => { in_set => 'A' } generates the SQL > "A IN COLUMN". This seems like the reverse of normal usage, e.g. "name > IN ('john','paul')". Can anyone explain what this might be used for? It's used for the SET column type sup

Re: [RDBO] Rose::DB::Object subclass instances within Safe compartment

2006-06-06 Thread Ethan Rowe
John Siracusa wrote: > If related objects are fetched by the Manager due to require_objects > or with_objects parameters, they should be attached as full-fledged > objects. Can you can show me an instance (sample code) where this is > not the case? That's good to know; I was making something of

Re: [RDBO] Rose::DB::Object::Loader

2006-04-29 Thread John Siracusa
On 4/29/06 12:20 PM, Guillermo Roditi wrote: > It seems to run fine but then I have no output or anything? is it supposed > to ouput to stdout? or a file? It depends on which methods you call. > -- > #! /usr/bin/perl -w > use strict; > use warnings; > use diagnostics; > use Ro

Re: [RDBO] Rose::DB::Object::Metadata::Auto::Oracle

2006-03-02 Thread Ron Savage
On Thu, 02 Mar 2006 23:02:49 -0500, John Siracusa wrote: Hi John > On 3/2/06 10:48 PM, Ron Savage wrote: >> I'm writing auto_retrieve_primary_key_column_names in this >> module, and the problem is the call $schema = $self- >> >select_schema($db). >> >> Oracle needs to to return uc $username. >>

Re: [RDBO] Rose::DB::Object::Metadata::Auto::Oracle

2006-03-02 Thread John Siracusa
On 3/2/06 10:48 PM, Ron Savage wrote: > I'm writing auto_retrieve_primary_key_column_names in this module, and the > problem is the call $schema = $self->select_schema($db). > > Oracle needs to to return uc $username. You can do whatever you want in Rose::DB::Object::Metadata::Auto::Oracle. Just

Re: [RDBO] Rose::DB::Object::Metadata::Auto V 0.66 via Rose::DB::Object V 0.681

2006-03-01 Thread John Siracusa
On 3/2/06 12:41 AM, Ron Savage wrote: > I wasn't intending to work on it. I just wanted to fiddle it to see what > happened with my source code generator. Ah, okay. I added it to the branch anyway, though. At the very least, it'll give me good practice doing merges in SVN :) > For the record, w

Re: [RDBO] Rose::DB::Object::Metadata::Auto V 0.66 via Rose::DB::Object V 0.681

2006-03-01 Thread Ron Savage
On Wed, 01 Mar 2006 23:39:42 -0500, John Siracusa wrote: Hi John > Ah, I didn't know you were editing Rose::DB::Object modules yet. > I'll add them to the Oracle branch. I wasn't intending to work on it. I just wanted to fiddle it to see what happened with my source code generator. > Having jus

Re: [RDBO] Rose::DB::Object::Metadata::Auto V 0.66 via Rose::DB::Object V 0.681

2006-03-01 Thread John Siracusa
On 3/1/06 10:44 PM, Ron Savage wrote: > Pursuant to my attempts to generate Perl code under Oracle, I had to make a > number of patches to this module. Ah, I didn't know you were editing Rose::DB::Object modules yet. I'll add them to the Oracle branch. Having just taken a casual look at your cha

Re: [RDBO] Rose::DB::Object::Metadata::Column::Varchar truncates long values?

2005-12-27 Thread John Siracusa
On 12/27/05 9:25 PM, Daniel Pittman wrote: > To my great surprise, a 'varchar' column will truncate a long value if > the 'length' argument is supplied, rather than reject it. Yeah, some people want truncation, some want a warning, and some want a fatal error. I should make this configurable. An