[Bast-commits] r6563 - in
branches/DBIx-Class-Schema-Loader/current: .
lib/DBIx/Class/Schema/Loader lib/DBIx/Class/Schema/Loader/DBI
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Tue Jun 9 13:26:03 GMT 2009
Author: caelum
Date: 2009-06-09 13:26:01 +0000 (Tue, 09 Jun 2009)
New Revision: 6563
Modified:
branches/DBIx-Class-Schema-Loader/current/
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI.pm
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm
Log:
r4530 at hlagh (orig r6425): caelum | 2009-05-25 16:45:11 -0700
make quoter/name_sep builders overridable methods
Property changes on: branches/DBIx-Class-Schema-Loader/current
___________________________________________________________________
Name: svk:merge
- 46bc3436-8211-0410-8564-d96f7a728040:/local/DBIx-Class-Schema-Loader/branches/common-dump:37173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-Schema-Loader/odbc-mssql:6424
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class-Schema-Loader:5726
+ 46bc3436-8211-0410-8564-d96f7a728040:/local/DBIx-Class-Schema-Loader/branches/common-dump:37173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-Schema-Loader/odbc-mssql:6425
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class-Schema-Loader:5726
Modified: branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm 2009-06-09 13:25:36 UTC (rev 6562)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm 2009-06-09 13:26:01 UTC (rev 6563)
@@ -34,6 +34,11 @@
$self->{db_schema} ||= 'dbo';
}
+# DBD::Sybase doesn't implement get_info properly
+#sub _build_quoter { [qw/[ ]/] }
+sub _build_quoter { '"' }
+sub _build_namesep { '.' }
+
sub _table_pk_info {
my ($self, $table) = @_;
my $dbh = $self->schema->storage->dbh;
Modified: branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI.pm 2009-06-09 13:25:36 UTC (rev 6562)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI.pm 2009-06-09 13:26:01 UTC (rev 6563)
@@ -46,14 +46,8 @@
}
# Set up the default quoting character and name seperators
- $self->{_quoter} = $dbh->get_info(29)
- || $self->schema->storage->sql_maker->quote_char
- || q{"};
-
- $self->{_namesep} = $dbh->get_info(41)
- || $self->schema->storage->sql_maker->name_sep
- || q{.};
-
+ $self->{_quoter} = $self->_build_quoter;
+ $self->{_namesep} = $self->_build_namesep;
# For our usage as regex matches, concatenating multiple quoter
# values works fine (e.g. s/\Q<>\E// if quoter was [ '<', '>' ])
if( ref $self->{_quoter} eq 'ARRAY') {
@@ -65,6 +59,22 @@
$self;
}
+sub _build_quoter {
+ my $self = shift;
+ my $dbh = $self->schema->storage->dbh;
+ return $dbh->get_info(29)
+ || $self->schema->storage->sql_maker->quote_char
+ || q{"};
+}
+
+sub _build_namesep {
+ my $self = shift;
+ my $dbh = $self->schema->storage->dbh;
+ return $dbh->get_info(41)
+ || $self->schema->storage->sql_maker->name_sep
+ || q{.};
+}
+
# Override this in vendor modules to do things at the end of ->new()
sub _setup { }
@@ -79,7 +89,8 @@
my $dbh = $self->schema->storage->dbh;
my @tables = $dbh->tables(undef, $self->db_schema, $table, $type);
- s/\Q$self->{_quoter}\E//g for @tables;
+
+ s/\Q$self->{_quoter}\E//g for @tables;
s/^.*\Q$self->{_namesep}\E// for @tables;
return @tables;
More information about the Bast-commits
mailing list