On Tue, 21 Oct 2008, Bernhard Graf wrote:
Jess Robinson wrote:
I haven't heard/seen this "common practice" anywhere.. But if you're
Well I did. The only I remember right now is Lyris list server.
determined, you want to define your columns as:
_name => {
accessor => 'name',
data_type => 'varchar',
..
}
To get the deploy system to create them with underscores in your
database, while accessing them using the non-underscored versions in
your code.
Thank you Jess. Finally I get an answer to my actual question.
I tried the above, but this seems half-baken:
While deploy() works as expected, and also accessing the column with
$rs->name() works, using the name in an argument list is not supported.
You still have to say:
$rs->create({_name => '...'});
Oops, I forgot to mention that minor hiccup. Yup, that's the way it works
for now..
You could patch SQL::Translator::Parser::DBIx::Class (in the dbic dist
package) to use the name => .. key in the column_info.. then you could use
as you first mentioned and deploy (which uses sqlt) would work.
Jess
_______________________________________________
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/[email protected]