[Dbix-class] Documentation of DBIx::Class schemas

Jess Robinson castaway at desert-island.me.uk
Thu Nov 8 15:32:24 GMT 2007



On Wed, 7 Nov 2007, RICHARD COX wrote:

> Not sure about other RDBMSs but in Oracle you can
> create comments on tables, columns, views, pretty much
> anything.
>
>> comment on TABLE_NAME is 'Foo';
>> comment on column TABLE_NAME.COLUMN)NAME IS 'Bar';
>
> Comments can contain any text (markup etc) up to 4000
> characters and you can get at them with reqular sql
>
>> select * from user_tab_commments;
>> select * from user_col_comments;
>
> So no need for an extra 'docs' key in your column_info

SQL::T supports this too, and thus so does DBIC. If you pass in a comments 
=> '' key to your column_info, that info will be output as "comment on 
column XX" in your sql.. For Oracle, anyways, the other producers do 
something appropriate for each DB (most of which probably mean "--" 
comments ;)

Jess


>> -----Original Message-----
>> From: Pedro Melo [mailto:melo at simplicidade.org]
>> Sent: 07 November 2007 17:25
>> To: DBIx::Class user and developer list
>> Subject: [Dbix-class] Documentation of DBIx::Class
> schemas
>>
>> Hi,
>>
>> I was wondering how do you document your schemas?
>>
>> I started adding 'docs' keys to the extra hash for
> each
>> column. I've also added a Doc component that allows
> me to set
>> up some texts as documentation for the class.
>>
>> Then I can use basic introspection and generate the
> entire
>> documentation (right now using a
> Catalyst::Controller).
>>
>> To prevent unnecessary memory usage in production,
> all the
>> text of the docs is not kept unless a environment
> variable is set.
>>
>> I wonder what other people is doing....
>>
>> Best regards,
>> --
>> Pedro Melo
>> Blog: http://www.simplicidade.org/notes/
>> XMPP ID: melo at simplicidade.org
>> Use XMPP!
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.rawmode.org
>



More information about the DBIx-Class mailing list