[Dbix-class] spaces in my column names... help?
Tom Lanyon
tom at netspot.com.au
Thu Apr 19 05:12:39 GMT 2007
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
More information about the Dbix-class
mailing list