Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Rose::DB and DBIx

by siracusa (Friar)
on Mar 28, 2008 at 23:28 UTC ( [id://677144]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Rose::DB and DBIx
in thread Rose::DB and DBIx

In RDBO, each object represents a single, uniquely identified row in a table. Therefore, there must be some way to uniquely identify a row in a table. Any unique key will do, even if it's not specified as a primary key constraint in the database. But RDBO will need something that it calls a primary key. You can pick one of the unique keys and tell RDBO that it is the primary key, for example.

(You can actually create RDBO-derived classes that front tables without unique or primary keys, but the load() and save() object methods will not work as designed, for what I hope are obvious reasons.)

Replies are listed 'Best First'.
Re^5: Rose::DB and DBIx
by Anonymous Monk on Apr 08, 2008 at 02:14 UTC
    Can Rose::DB use a primary key that spans multiple columns? Also, does anyone know if of a support matrix comparing supported features of roseDB with DBIC and CDBI?
      Well, I found the answer to the first part of my question tucked away in the tutorial:
      The table must have a primary key, and may have zero or more unique keys. The primary key and each unique key may contain multiple columns.

      Also, if you are desparate there is even a workaround for not having a primary key:
      If the table has a multi-column primary key or does not use a column type that supports auto-generated values, you can define a custom primary key generator function using the primary_key_generator method of the Rose::DB::Object::Metadata-derived object that contains the metadata for this class.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://677144]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-24 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found