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
//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
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
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
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
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,
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
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
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,
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
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
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
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?
>
>
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
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_
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
16 matches
Mail list logo