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

2007-06-04 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 possible?
SQLite doesn't support foreign keys, and there is no mention of them in my
schema, which is roughly not more than

Create Table user (user Integer Primary Key Autoincrement Not Null, realname
text);
Create Table collection (user Integer References user(user), collection
text, Primary Key (user, collection));

Maybe Convention methods are trying to guess by column names?




-John




--
Iļja Ketris | iPro SIA  | +371 800 IPRO
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


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 of.  There are many examples in the RDBO test suite.
Look at t/db-object-loader.t and search for SQLite:

http://search.cpan.org/src/JSIRACUSA/Rose-DB-Object-0.764/t/db-object-loader.t

CREATE TABLE products
(
  ...
  vendor_id  INT REFERENCES vendors (id),
  ...
);

 and there is no mention of them in my schema, which is roughly not more than

 Create Table user (user Integer Primary Key Autoincrement Not Null, realname
 text);
  Create Table collection (user Integer References user(user), collection
 text, Primary Key (user, collection));

That ... Integer References user(user) part creates a foreign key in
SQLite.  That's what the Loader is picking up.

-John
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


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



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object