How should I reveal all the linked tables for any table?

36 views
Skip to first unread message

bvn13

unread,
Oct 19, 2012, 3:20:32 AM10/19/12
to rose-db...@googlegroups.com
Hello.
My current task is to make a web-interface for the DB using Rose::DB::Object.
And I have an issue. It's about how to reveal linked tables.
I.e., one table is named FRIENDS with fields:
- HUMAN_ID -> link to the table HUMANS by ID field
- some other fields

I create Rose::DB::Object for table FRIENDS with automatic resolving of structure.
And then I want to realize an universal Web-Widget, that will show all the fields contained in this table.
All the simple fields are shown as simple <input>-s, but what should I do with linked fields?
In particular way, I make a foreach-circle on MyProject::DB::Friends->meta->column_names and just make an input for each of them. 
But I need to exclude all the links to make an input with autocompletion plugin inited on them.

Please help me with this issue.

John Siracusa

unread,
Oct 19, 2012, 7:52:37 AM10/19/12
to rose-db...@googlegroups.com
You might be able to get some ideas from this module:

http://search.cpan.org/dist/Rose-DBx-Garden/

-John

Danny Liang

unread,
Oct 19, 2012, 8:11:37 AM10/19/12
to rose-db...@googlegroups.com
Hello,

Relationship columns and foreign keys ("Linked fields") can be
realised using simple select boxes. I've used that in
http://search.cpan.org/dist/Rose-DBx-Object-Renderer/

Input field with autocomplete works may work as well, but that
probably requires some heavier server-side validation - who knows what
end-users will put into those fields.

Cheers,
Danny
> --
> CPAN: http://search.cpan.org/dist/Rose-DB-Object
> SVN: http://rose.googlecode.com/svn/trunk/modules/Rose-DB-Object
> SVN Instructions: http://code.google.com/p/rose/source/checkout
> Unsubscribe: rose-db-objec...@googlegroups.com
> List Options: http://groups.google.com/group/rose-db-object

bvn13

unread,
Oct 29, 2012, 6:06:01 AM10/29/12
to rose-db...@googlegroups.com
ough... I tried to print Dumper $object->meta. Neither relationships nor foreign_keys was listed.
Here is my initialization:

__PACKAGE__->meta->setup(
   schema => 'catalogs',
   table => '$tablename',
   auto => 1
);

All the tables are initializing dynamically. I have no static classes for them. Only one DB::_Generator.

Do you have any idea for my issue?
Reply all
Reply to author
Forward
0 new messages