[Dbix-class] Automatic quoting

Will Hawes wdhawes at gmail.com
Fri Jun 4 09:02:30 GMT 2010


Yesterday a colleague new to DBIC ran into a problem with a column
named using a reserved word in MySQL. He worked around it by using a
different column name, but while discussing the issue he asked why
quote_char and name_sep are not set automatically. I don't know the
answer and Googling has left me none the wiser.

I'd have thought that if the dsn contains "dbi:mysql", it should be
safe to assume that quote_char should be "`" and so on - the unsafe
cases being things like "dbi:ODBC" where you can't determine the
database from the dsn (although there may be other ways to work it out
from $schema->storage->dbh).

Is there a reason for only allowing quoting to be set up manually, or
is this a case of patches welcome?



More information about the DBIx-Class mailing list