[RDBO] add_relationships() won't work after auto_initialize()

2006-07-19 Thread rose
Hi rose-db-object, first off, Rose::DB* is fantastic, I love it. I've found a minor glitch, though: Adding relationships to a table doesn't seem to work after auto_initialize() gets called. In fact, a call to add_relationships() *after* auto_initialize() will simply be ignore

Re: [RDBO] add_relationships() won't work after auto_initialize()

2006-07-20 Thread rose
//www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object

[RDBO] Auto-initialize many-to-many relationships?

2006-08-17 Thread rose
Is there a way for Rose to auto-initialize a schema that has a many-to-many relationship defined? Here's the schema: mysqladmin -u root create testdb CREATE TABLE IF NOT EXISTS firsts ( id INT AUTO_INCREMENT NOT NULL PRIMARY KEY, nameVARCH

[RDBO] Suppressed error message if db driver fails to load

2006-08-17 Thread rose
var not set at ... Turned out that it was an installation problem with a DateTime module required by Rose::DB::MySQL. The reason why the error message is so mysterious is that the real error gets suppressed here: Rose::DB.pm unless($Class_Loaded{$driver_class}) { eval "r

[RDBO] update() nukes foreign key

2006-11-22 Thread rose
Hi there, I'm seeing the following behaviour with Rose::DB::Object 0.756: Here's a simple product/vendor relationship with the recommended MySQL tweaks: CREATE TABLE vendors ( id INTEGER PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255) ) Type=InnoDB; CREATE TABL

[RDBO] load(speculative) opens new DB connections

2006-11-22 Thread rose
the code: use strict; use Rose::DB::Object::Loader; my $loader = Rose::DB::Object::Loader->new( db_dsn => 'dbi:mysql:dbname=testdb2', db_username => 'root', db_options => { AutoCommit => 1, ChopBlanks => 1,

Re: [RDBO] update() nukes foreign key

2006-11-22 Thread rose
On Thu, 23 Nov 2006, John Siracusa wrote: > Try calling save() and not update(). Perfect, thanks! Guess my problem is that I have been using Class::DBI a lot and and update() in Class::DBI is the equivalent of save() in Rose. You should add a use Rose::DB::Object

Re: [RDBO] load(speculative) opens new DB connections

2006-11-22 Thread rose
On Thu, 23 Nov 2006, John Siracusa wrote: > Hm, I don't recall ever making a "0.756_01" version... Internal magic, sorry. 0.756 is the version I used. > Each RDBO object gets its db (if one is not already set) by > calling init_db(). By default, init_db() returns a new

Re: [RDBO] load(speculative) opens new DB connections

2006-11-23 Thread rose
On Thu, 23 Nov 2006, John Siracusa wrote: > > BTW, are these DB connections closed? > > That's what I meant when I wrote this: > > >> (In all of the above code, you should think about the eventual destruction > >> of those global objects.) Yeah, I noticed,

[RDBO] SELECT DISTINCT on a single column

2006-12-03 Thread rose
Is there a way to use DISTINCT on a single field in Rose::DB? I have a table like ++-+---+ | id | event_time | some_val | ++-+---+ | 1 | 2006-12-03 09:15:00 | 1 | | 2 | 2006-12-03 09:15:00

Re: [RDBO] SELECT DISTINCT on a single column

2006-12-03 Thread rose
t;get_distinct_values( > column => 'some_val', > query => [ event_time => { gt => ... } ]); > > and so on. Generalizing get_distinct_values() to work for any Manager class > is left as an exercise for the reader (hint: "object_cla

[RDBO] Paging with Iterators

2007-03-23 Thread rose
I'm using Rose with a fairly large MySQL database and using an iterator like my $itr = Bar->get_bars_iterator(); while($itr->next()) { won't work because by default, an iterator will read in all records from the DB, which won't fit into memory. Usi

Re: [RDBO] Paging with Iterators

2007-03-23 Thread rose
not be in charge of keeping track > of which page I'm currently reading and if there's more pages to > be fetched. > > So I thought: Couldn't Rose have 'pager' objects acting like iterators, > but fetching all available data in configurable chunks? > >

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

2007-03-23 Thread rose
On Fri, 23 Mar 2007, John Siracusa wrote: > If you add the same bar twice, it'll add a new mapping each time. > That's what add_bars() does. Given that Rose knows that this is a many-to-many relationship between foos and bars, isn't it pretty far-fetched that you would ac

[RDBO] "closing dbh with active statement handles" still a problem?

2008-02-11 Thread rose
When I create a table like CREATE TABLE samples ( id INTEGER PRIMARY KEY, foo TEXT ); with SQLite and use the following Rose code: use Rose::DB::Object::Loader; my $loader = Rose::DB::Object::Loader->new( db_

Mailman results for Rose-db-object

2005-09-30 Thread rose-db-object-request
This is an automated response. There were problems with the email commands you sent to Mailman via the administrative address <[EMAIL PROTECTED]>. To obtain instructions on valid Mailman email commands, send email to <[EMAIL PROTECTED]> with the word "help" in the subject line or in the body of t