On 19/04/2007, at 12:07 PM, Michael Higgins wrote:

Hello, all --

I am trying to set up a simple relationship using schema.

Problem is, the database has column names like 'Invoice #' and 'Bill To'.

The error code for belongs_to and has_many is "no such column billto on
foreign class...".

This is true, of course. It has a space in the name.

How do I get DBIx::Class::Schema to look for the right column?

Any clue or example here greatly appreciated.


You need to quote the table/column names. Read the connect_info() docs on DBIx::Class::Storage::DBI.

Normally you'd have something like:

Your::Schema->connect([ $dsn, $user, $pass, \%dbi_opts, { quote_char => q{`}, name_sep => q{.} } ]);

Cheers,
Tom

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to