Subject: | DBIC::SQL::Abstract problems with tables whose names are reserved words |
DBIx::Class fails to work with tables whose names are reserved SQL
keywords (e.g. "group"). I get the following error
DBIx::Class::Schema::Loader::make_schema_at(): DBI Exception:
DBD::SQLite::db prepare failed: near "group": syntax error [for
Statement "SELECT * FROM group WHERE ( 1 = 0 )"] at
C:/strawberry/perl/site/lib/Catalyst/Helper/Model/DBIC/Schema.pm line 173
I traced this down to DBIC::SQL::Abstract, which has the following code:
sub select {
my ($self, $table, $fields, $where, $order, @rest) = @_;
$table = $self->_quote($table) unless ref($table);
SQL::Abstract has a "quote_char" option which is empty by default and if
it is not set "$self->_quote($table)" has no effect. DBIx::Class should
provide the user with an option to use a quote character when generating
queries.