Re: [RDBO] Relationships and queries across multiple databases

2007-10-01 Thread John Siracusa
On 10/1/07 1:17 PM, Kurt Hansen wrote: Hmm...I'm not sure if the lack of response on this question is because no-one is doing this, it isn't possible within RDBO, my e-mail was last, or my question was incoherent. While the incoherence of the message is a definite possibility -- :-), even

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

2007-09-26 Thread John Siracusa
On 9/26/07 6:28 PM, Jonathan Swartz wrote: I'm curious to know what the motivation was for Rose::DB to handle ref counting in the first place. Is/was this DBI disconnect-on- destroy behavior not always reliable? Rose::DB's involvement in $dbh destruction is so it can run the pre_disconnect_sql

Re: [RDBO] sort_by change in recent release causes an issue

2007-09-13 Thread John Siracusa
On 9/13/07, Wiggins d'Anconia [EMAIL PROTECTED] wrote: $sort_by = join(', ', map { ref $_ ? $$_ : $_ } @$sort_by) if(ref $sort_by); In the above any argument that is a reference attempts to dereference a scalar, which is problematic for obviously anything that is not a scalar, which in

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

2007-09-07 Thread John Siracusa
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 all other times the method should return whatever value the object holds. agreed. IIRC, I was

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

2007-09-07 Thread John Siracusa
On 9/7/07, Graham Barr [EMAIL PROTECTED] wrote: On Sep 7, 2007, at 1:49 PM, John Siracusa wrote: I'll provide a global way to turn it on, however. Probably: Rose::DB::Object::Metadata::Column-default_undef_sets_null(1); which you can put in your common base class or wherever. OK

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

2007-09-06 Thread John Siracusa
On 9/6/07 10:01 PM, Ask Bjørn Hansen wrote: We have some columns that are NULL but with a specified default value (for example 0). deleted = { type = 'integer', default = '0' }, Sometimes we need to set it to undef/NULL (a valid value), but RDBO unhelpfully resets that to the

Re: [RDBO] Generating modules with a side of documentation

2007-09-05 Thread John Siracusa
On 9/5/07, Clayton Scott [EMAIL PROTECTED] wrote: I can get the columns from both tables but not the table name. Previously when generating forms from table definitions I've gotten around this by actually loading the FK class. I can't in this case because the class hasn't been generated yet.

Re: [RDBO] Remote DB connection over SSL to MySQL DB using Rose::DB

2007-09-03 Thread John Siracusa
On 9/3/07 12:31 PM, Kurt Hansen wrote: However, I did not try the connect_options method based on your inlined into the DSN comment and reading up on the Rose::DB and DBI docs. The SSL options DO need to be inlined into the DSN Okay, I'll make the change in SVN when I get a chance. so I took

Re: [RDBO] How to register a db using DBI::Proxy?

2007-08-29 Thread John Siracusa
On 8/29/07, Michael Lackhoff [EMAIL PROTECTED] wrote: Did you find some time for DBI::Proxy support, yet? No, sorry, haven't gotten to it yet. -John - This SF.net email is sponsored by: Splunk Inc. Still grepping through

[RDBO] RDBO 0.7x to 1.0

2007-08-18 Thread John Siracusa
On 8/17/07 6:25 PM, Derek Watson wrote: This is off-topic, but what lies ahead on the road between RDBO 0.7xx and 1.0? Are there specific features you have in mind that will push us further along, or is it just general maturity (eg. bug fixes and interface updates)? There are some specific

Re: [RDBO] Still fighting with transactions

2007-08-15 Thread John Siracusa
On 8/15/07 3:11 AM, Michael Lackhoff wrote: On 14.08.2007 22:43 John Siracusa wrote: Assuming your have AutoCommit turned off, that's why $obj was not saved. The rollback rolled back everything done since the last begin_work(). Well, I didn't switch AutoCommit on or off Was it on or off

Re: [RDBO] Still fighting with transactions

2007-08-15 Thread John Siracusa
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? Turn on DBI-trace(1) to be sure it actually is, and maybe try to create a small test case. the problem

Re: [RDBO] help specifying a default datetime with SQLite and RDBO::Loader

2007-08-14 Thread John Siracusa
On 8/14/07, George Hartzell [EMAIL PROTECTED] wrote: The default value of now does work when used in the RDBO perl module. The problem is that since I'm using RDBO::Loader, the only way to get that value in there is to use it in the SQL, where it doesn't do what is intended. Remember that

Re: [RDBO] Still fighting with transactions

2007-08-14 Thread John Siracusa
On 8/14/07, Michael Lackhoff [EMAIL PROTECTED] wrote: And to the second alternative, how do I have to setup RDBO with mod_perl to share a db (and dbh with it) for everything within one process/request but not across multiple processes? The simplest way to do this is to leave everything as per

Re: [RDBO] Still fighting with transactions

2007-08-14 Thread John Siracusa
On 8/14/07, Perrin Harkins [EMAIL PROTECTED] wrote: Note that Apache::DBI also does the automatic rollback for you, but only if you have AutoCommit off when you connect. If you connect with AutoCommit on, you have to handle the rollback yourself. Doesn't Apache::DBI just care that

Re: [RDBO] Still fighting with transactions

2007-08-14 Thread John Siracusa
On 8/14/07, Perrin Harkins [EMAIL PROTECTED] wrote: On 8/14/07, John Siracusa [EMAIL PROTECTED] wrote: Doesn't Apache::DBI just care that $dbh-{AutoCommit} is false at the time it checks in the cleanup handler? Look further up in the code. It never pushes the handler unless AutoCommit

Re: [RDBO] Still fighting with transactions

2007-08-14 Thread John Siracusa
On 8/14/07, Perrin Harkins [EMAIL PROTECTED] wrote: On 8/14/07, John Siracusa [EMAIL PROTECTED] wrote: I looked for that and didn't see it, and still don't see it. Sorry, this was actually changed already. I was looking at an older release. Phew. Because I have stuff going to production

Re: [RDBO] Still fighting with transactions

2007-08-14 Thread John Siracusa
On 8/14/07, Michael Lackhoff [EMAIL PROTECTED] wrote: $db-begin_work; my $obj = Products-new(db = $db); ... $obj-save; some_helper_that_uses_db(); # rollback here my $obj2 = Customers-new(db = $db); ... $obj2-save; $db-commit; When I ran this code $obj2 was saved but $obj was rolled

Re: [RDBO] Still fighting with transactions

2007-08-14 Thread John Siracusa
On 8/14/07, Michael Lackhoff [EMAIL PROTECTED] wrote: On 14.08.2007 20:34 John Siracusa wrote: On 8/14/07, Michael Lackhoff [EMAIL PROTECTED] wrote: $db-begin_work; my $obj = Products-new(db = $db); ... $obj-save; some_helper_that_uses_db(); # rollback here my $obj2 = Customers-new

Re: [RDBO] has_loaded_related issue

2007-08-11 Thread John Siracusa
On 8/11/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: so let me rephrase this question: i thought strip() wasn't supposed to remove fkeys/rels ? it seems to be doing so in .765 http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Helpers.pm#strip By default, the db object

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] help specifying a default datetime with SQLite and RDBO::Loader

2007-08-08 Thread John Siracusa
On 8/7/07 5:12 PM, George Hartzell wrote: If I change Rose::DB::SQLite::validate_datetime_keyword so that it'll accept 'current_timestamp' Yeah, I should do that... then the value gets inserted literally into the table. it probably also needs to be inlined (i.e., unquoted) I'd like to be

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] unexpected (by me) behavior in relationships

2007-08-06 Thread John Siracusa
On 8/5/07, Ricardo SIGNES [EMAIL PROTECTED] wrote: Okay, at this point I looked at the docs and decided to try using with $group-load(with = 'groups'); @u = $group-users; is(@u, 1); # hooray! ...except when I was about to cheer about this on IRC, I noticed that I'd said with =

Re: [RDBO] 'now' for dates in SQLite

2007-08-04 Thread John Siracusa
On 8/4/07, Ricardo SIGNES [EMAIL PROTECTED] wrote: I can't find this documented, and it seems like a very imporant default to document, given the obnoxious way in which the database-level defaults for datetimes and the like can differ. The first thing to understand is that the default can be

[RDBO] Version 0.765 is coming

2007-07-20 Thread John Siracusa
Version 0.765 will be released to CPAN this weekend, barring an unforeseen events. If you find any remaining show-stopper bugs, speak up soon! :) As a reminder, SVN is at: https://rose.svn.sourceforge.net/svnroot/rose You will need to check out Rose-DB as well as Rose-DB-Object. More links

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

2007-07-20 Thread John Siracusa
) - John Siracusa [EMAIL PROTECTED] * Added a value_type attribute to SET columns. * Added a normalize_get_objects_args() utility method to make custom Manager methods less cumbersome to implement. * Setting a BigInt column to undef no longer sets it to zero. (Reported by Jeffrey

[RDBO] Wiki spam

2007-07-11 Thread John Siracusa
Anyone want to help me clean out spam on the RDBO wiki? I've fallen behind in doing it again. http://rose.sourceforge.net/wiki/ The recent changes page is a good place to start: http://rose.sourceforge.net/wiki/index.php/Special:Recentchanges I keep looking for an anti-spam solution that

Re: [RDBO] feature request - is not

2007-07-09 Thread John Siracusa
On 4/30/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: i'd like to see an is not operator I've added is/is_not operators to QueryBuilder in SVN. Give them a spin and let me know if they do what you want. -John - This

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

2007-07-09 Thread John Siracusa
On 5/25/07, James Masters [EMAIL PROTECTED] wrote: Table or relationship names can be used in the value of the query parameter, but the with_objects and require_objects parameters only accept foreign key and relationship names. I think the error you got is because you put productlocs in

Re: [RDBO] loader dies if pg table has unique index when make_modules is called

2007-07-09 Thread John Siracusa
On 4/2/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: testing some more, i found out that this happens only on a function index ie: works: CREATE UNIQUE INDEX email_uidx ON table(email) breaks: CREATE UNIQUE INDEX email_uidx ON

Re: [RDBO] unblessed reference due to relationship name clash with existing class

2007-07-06 Thread John Siracusa
On 6/28/07, Philip Dye [EMAIL PROTECTED] wrote: Here are two classes, the first works as expected the second fails with the listed error message: [...] Can't call method Id on unblessed reference at .../Rose/DB/Object/MakeMethods/Generic.pm line 3470. This is a Perl issue, not an RDBO

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

2007-07-06 Thread John Siracusa
On 6/19/07, John Siracusa [EMAIL PROTECTED] wrote: On 6/18/07, mla [EMAIL PROTECTED] wrote: Subselect? SELECT count(*) FROM ( SELECT DISTINCT a_id, b_id FROM a_b_map WHERE a_id = xxx ) s That's the solution I went with. It's fixed now in SVN. -John

Re: [RDBO] $object-related_iterator

2007-07-06 Thread John Siracusa
On 7/6/07, Michael Reece [EMAIL PROTECTED] wrote: i've skimmed the docs again and don't see it, but is there an easy way to generate _iterator methods for one-to-many relationships? No, but creating one wouldn't be hard. It's basically just the existing find method, with the get_objects() call

Re: [RDBO] Rose ODBC

2007-07-05 Thread John Siracusa
On 7/5/07, Ron Savage [EMAIL PROTECTED] wrote: Is adding ODBC support to Rose contraindicated (due, perhaps, to something deep with Rose)? I know nothing about ODBC and have never used it, so I couldn't tell you... -John

Re: [RDBO] Boolean cannot set NULL

2007-07-05 Thread John Siracusa
On 7/5/07, Derek Watson [EMAIL PROTECTED] wrote: Is there a way to set a RDBO boolean column to NULL? It seems to me that undef evaluates to FALSE. $obj-bool_column(undef); $obj-save; print $obj-bool_column; # 0 It's a bug, now fixed in SVN. Thanks for the report. -John

Re: [RDBO] epoch column type and 0 values

2007-07-04 Thread John Siracusa
On 6/28/07, Peter Karman [EMAIL PROTECTED] wrote: I have a column defined like: complete = {type = 'epoch', default = '0', not_null = 1, time_zone = 'UTC'}, That works great until I load a record with complete = 0 and then try and save it without modifying the complete value.

Re: [RDBO] on the fly fields

2007-07-03 Thread John Siracusa
On 7/3/07, James Masters [EMAIL PROTECTED] wrote: which of course fails with Unknown column 't1.C_sourceyear'. In SVN, scalar refs are now passed through unmodified when they appear as sort_by args. So this should work for you in 0.765: sort_by = [ \q(C_sourceyear) ] -John

Re: [RDBO] missing column aliases in recent version(s)

2007-07-02 Thread John Siracusa
Okay, I've made the change in SVN. RDBO 0.765 will have tN table aliasing on by default, even for queries that only involve a single table. The new table_aliases Manager parameter can be used to force the old behavior. -John

Re: [RDBO] missing column aliases in recent version(s)

2007-07-01 Thread John Siracusa
On 6/30/07 11:45 PM, Michael Lackhoff wrote: On 30 Jun 2007 at 17:10, John Siracusa wrote: Tables are only aliased as tN when more than one table is involved in the query. This more than one count does not include literal subqueries like yours, however. I'm thinking of changing it in 0.765

Re: [RDBO] missing column aliases in recent version(s)

2007-06-30 Thread John Siracusa
On 6/30/07, Michael Lackhoff [EMAIL PROTECTED] wrote: The subselect I use, relies on the aliasing of 'gruppen' to 't1'. Of course I can just change the definition to use the original table name but since I didn't find any mention in the change log, perhaps this is a bug? Tables are only

Re: [RDBO] Two RDBO hierarchies interfering (with test)

2007-06-29 Thread John Siracusa
On 6/26/07, Adrian Howard [EMAIL PROTECTED] wrote: On 25 Jun 2007, at 16:33, John Siracusa wrote: I'd like to see a small, self-contained, reproducible test case. If you could post one and describe how you'd like it to behave and what it actually does instead, that'd be helpful Attached

Re: [RDBO] odd behavior due to typo in primary key

2007-06-27 Thread John Siracusa
On 6/27/07, Philip Dye [EMAIL PROTECTED] wrote: Should not Rose::DB::Object complain at some point during setup or perhaps on first use of the class when a listed primary key column is missing from the list of columns ? I have a check for this in Metadata.pm: foreach my $name

Re: [RDBO] on the fly fields

2007-06-26 Thread John Siracusa
On 6/26/07, James Masters [EMAIL PROTECTED] wrote: ); $loader-post_init_hook( sub { my $meta = shift; # For class My::Product, try to load My::Product::Extra my $extra_pm = $meta-class .'::Extra'; eval require $extra_pm; }); my @classes

Re: [RDBO] Two RDBO hierarchies interfering

2007-06-25 Thread John Siracusa
On 6/25/07, Adrian Howard [EMAIL PROTECTED] wrote: 1) I have a single process (mod_perl) with two different RDBO hierarchies connecting to two different databases from the same MySQL 5 server - each using their own IMA::DB subclasses Er, IMA::DB? 2) The two databases both have a table with

Re: [RDBO] setting many columns in update

2007-06-25 Thread John Siracusa
On 6/25/07, Iļja Ketris [EMAIL PROTECTED] wrote: I am trying to achieve a simple task of updating many columns in a row from a hash. %hash = (field1='foo', field2='bar' ...) While I can pass a hash to the new method $product = Product-new (%hash); I don't see a simple way to update a

Re: [RDBO] date parsing

2007-06-23 Thread John Siracusa
On 6/23/07, Iļja Ketris [EMAIL PROTECTED] wrote: What is the proper way of forcing European date parsing for a date or a timestamp column? What scope? Just for one column? For a certain data sources? Universally? -John

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's a

Re: [RDBO] defined'ness of getters for missing not-null fields

2007-06-21 Thread John Siracusa
On 6/21/07, Jonathan Swartz [EMAIL PROTECTED] wrote: Actually, upon reflection, it seems strange to me that column default values would have any effect on load(). That is, if I do User-new(some_unique_column = 'some value')-load() is there any legitimate reason I'd want a default

Re: [RDBO] Classless Rose::DB::Objects

2007-06-20 Thread John Siracusa
On 6/19/07, mla [EMAIL PROTECTED] wrote: Could you expand a bit on that first sentence? What's the purpose of the SQL abstraction? It's to provide a structured, mutable representation of SQL, rather than trying to deal with it as a big, opaque string. I wouldn't mind using SQL and then just

Re: [RDBO] Classless Rose::DB::Objects

2007-06-19 Thread John Siracusa
On 6/19/07, mla [EMAIL PROTECTED] wrote: The features I'm interested in are: o Providing a somewhat consistent interface between these ad-hoc result sets and normal RDBO objects. o Catching field typos which the accessors/mutators would give you. (although you could do the

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

2007-06-19 Thread John Siracusa
On 6/18/07, mla [EMAIL PROTECTED] wrote: Subselect? SELECT count(*) FROM ( SELECT DISTINCT a_id, b_id FROM a_b_map WHERE a_id = xxx ) s So far, that looks like the best option to me. Can anyone think of anything better? -John

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

2007-06-18 Thread John Siracusa
On 6/14/07, Derek Watson [EMAIL PROTECTED] wrote: 1. A fatal error is thrown when the object count is zero. I believe this is happening around line 2749 of MakeMethods::Generic: $count = $ft_manager-$ft_count_method(query = [EMAIL PROTECTED], db = $self-db,

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

2007-06-18 Thread John Siracusa
On 6/18/07, Derek Watson [EMAIL PROTECTED] wrote: Postgres defines the function separately from count(*): count(expression) number of input values for which the value of expression is not null In this case I would write SELECT COUNT(coalesce(t1.a_id, t1.b_id)) Which would count the

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

2007-06-13 Thread John Siracusa
On 6/13/07, Ovid [EMAIL PROTECTED] wrote: Thanks! Any idea when there might be a new stable release? End of the month, maybe. -John - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version

Re: [RDBO] get_objects with multiple one to many relations

2007-06-13 Thread John Siracusa
On 6/13/07 9:29 PM, Cees Hek wrote: Could you not just join the locations table twice? Actually, in the latest version, I don't think you can do that. But I wonder if I should (re)allow it. Opinions? -John - This

Re: [RDBO] get_objects with multiple one to many relations

2007-06-13 Thread John Siracusa
On 6/13/07 10:24 PM, Cees Hek wrote: Well, joining the same table twice is a valid SQL construct (similar to doing a self join), and it can be useful in certain situations. So I would vote to keep it... Was there a specific reason that it was changed? Or did it just happen as part of

Re: [RDBO] Postgresql default value for timestamp causes RDBO failure

2007-06-12 Thread John Siracusa
On 6/11/07, Fred Cox [EMAIL PROTECTED] wrote: insert() - Invalid default timestamp: '(now() + '21 days'::interval)' at /usr/local/lib/perl5/site_perl/5.8.8/Rose/DB/Object.pm line 1106 The column definition looks like this: tsexpire | timestamp without time zone | not null default

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

2007-06-11 Thread John Siracusa
On 6/11/07 8:46 AM, Ovid wrote: And when I try to delete the corresponding object in there: $self-delete_suspended; diag Dumper($self-suspended); I still have a Donhost::Server::Dedicated::Suspended object in there. I thought, maybe I need to save it first: You do, because the

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

2007-06-11 Thread John Siracusa
On 6/11/07 8:46 AM, Ovid wrote: In my meta setup for one object, I have the following: relationships = [ suspended = { class = 'Donhost::Server::Dedicated::Suspended', column_map = { server = 'server' }, type = 'one to one',

Re: [RDBO] augmenting ManyToMany default_auto_method_types

2007-06-11 Thread John Siracusa
On 6/11/07 1:21 PM, Michael Reece wrote: however, the error is in $@ and not $map_manager-error, so the reason for the failure is not reported. Thanks, I correct the error propagation when I get a chance. -John - This

Re: [RDBO] bug in many-to-many find_*

2007-06-10 Thread John Siracusa
On 6/10/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: some digging found the generated method spending the time merging all the args together, then didn't use them Oops :) Patch applied, thanks. -John - This SF.net

Re: [RDBO] Rose::DB + PostgreSQL + trigger problem

2007-06-07 Thread John Siracusa
On 6/7/07 3:04 AM, Cees Hek wrote: On 6/7/07, Neal Clark [EMAIL PROTECTED] wrote: Thank you for the prompt reply. I am not entirely sure I understood it, and I probably didn't give the right details when I mailed the list earlier today. If I change my id column from serial to integer it will

Re: [RDBO] add_on_save expected/bug?

2007-06-07 Thread John Siracusa
On 6/7/07 11:06 AM, Adrian Howard wrote: I had expected this: $o-add_foos( $foo1, $foo2 ); to be the same as: $o-add_foos( $foo1 ); $o-add_foos( $foo2 ); $o-save; It's not. The last add is the only one that counts. That may change someday, but for now that's how it is.

Re: [RDBO] Rose::DB + PostgreSQL + trigger problem

2007-06-06 Thread John Siracusa
On 6/6/07 9:28 PM, Neal Clark wrote: so, it this key constraint is being violated because the dropsite that was just -save'd, which would have had an id of 19, was in fact not inserted. Yet it does increment my dropsites_id_seq, because overtime i run this the row that is not present in table

Re: [RDBO] wishlist - better error message for incompatible type situation

2007-06-05 Thread John Siracusa
On 6/4/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: the error message is: Don't know how to handle comparison values %(value)d at %(file that called the manager function)s it would be nice if rose would a- note the problematic fields ( right now, it just spews 1 value ) b- note the

Re: [RDBO] Non sourceforge archive of list?

2007-06-05 Thread John Siracusa
On 6/5/07, Adrian Howard [EMAIL PROTECTED] wrote: Is there a non-sourceforge archive of this mailing list anywhere... sourceforge.net is giving me a 500 every time I try and get at things that look useful :-) Yeah, I tend to use this one:

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] getter/setters for relationships

2007-06-04 Thread John Siracusa
On 6/4/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: is there a convenient way to get a setter for a relationship? Yes, and it works the same way as for columns. Like columns, relationships and foreign keys have N named method types created on their behalf. Examples of method type names are

Re: [RDBO] getter/setters for relationships

2007-06-04 Thread John Siracusa
On 6/4/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: this might be where my confusion is -- mutator_method_name states Returns the name of the method used to set the column value. many items reference column -- but it seems like they work for fkeys/relationships to. maybe all i needed was a

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] Tables Without Primary Keys

2007-05-30 Thread John Siracusa
On 5/30/07 2:31 AM, David Lloyd wrote: Interestingly, it seems that Rose::DB::Object will attempt to make the first field that it can lexically see in the meta hash the primary key IF no primary key is given. Correct. I think that's documented somewhere, but I can't find it... Furthermore,

Re: [RDBO] relationships - foreign keys

2007-05-29 Thread John Siracusa
On 5/29/07, James Masters [EMAIL PROTECTED] wrote: Rose clearly cleverly deals with cascading deletes etc. regardless of whether foreign keys are used or not. But where foreign keys are in use, if I delete a parent table, does Rose know not to attempt the cascading delete itself and just let

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

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

[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] 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

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] 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-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] 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] 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] 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

[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] 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,

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

[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] 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.

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 =

<    1   2   3   4   5   6   >