[Bast-commits] r7343 - DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual
robkinyon at dev.catalyst.perl.org
robkinyon at dev.catalyst.perl.org
Wed Aug 19 19:44:51 GMT 2009
Author: robkinyon
Date: 2009-08-19 19:44:48 +0000 (Wed, 19 Aug 2009)
New Revision: 7343
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod
Log:
Applied doc patch by spb
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod 2009-08-18 20:45:06 UTC (rev 7342)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod 2009-08-19 19:44:48 UTC (rev 7343)
@@ -1522,13 +1522,13 @@
If the database contains column names with spaces and/or reserved words, they
need to be quoted in the SQL queries. This is done using:
- __PACKAGE__->storage->sql_maker->quote_char([ qw/[ ]/] );
- __PACKAGE__->storage->sql_maker->name_sep('.');
+ $schema->storage->sql_maker->quote_char([ qw/[ ]/] );
+ $schema->storage->sql_maker->name_sep('.');
The first sets the quote characters. Either a pair of matching
brackets, or a C<"> or C<'>:
- __PACKAGE__->storage->sql_maker->quote_char('"');
+ $schema->storage->sql_maker->quote_char('"');
Check the documentation of your database for the correct quote
characters to use. C<name_sep> needs to be set to allow the SQL
@@ -1547,6 +1547,17 @@
}
)
+In some cases, quoting will be required for all users of a schema. To enforce
+this, you can also overload the C<connect> method for your schema class:
+
+ sub connect {
+ my $self = shift;
+ my $rv = $self->next::method( @_ );
+ $rv->storage->sql_maker->quote_char([ qw/[ ]/ ]);
+ $rv->storage->sql_maker->name_sep('.');
+ return $rv;
+ }
+
=head2 Setting limit dialect for SQL::Abstract::Limit
In some cases, SQL::Abstract::Limit cannot determine the dialect of
More information about the Bast-commits
mailing list