__PACKAGE__->mk_group_accessors (simple => qw/quote_char name_sep limit_dialect/);
+sub _quoting_enabled {
+ ( defined $_[0]->{quote_char} and length $_[0]->{quote_char} ) ? 1 : 0
+}
+
# for when I need a normalized l/r pair
sub _quote_chars {
+
+ # in case we are called in the old !!$sm->_quote_chars fashion
+ return () if !wantarray and ( ! defined $_[0]->{quote_char} or ! length $_[0]->{quote_char} );
+
map
{ defined $_ ? $_ : '' }
( ref $_[0]->{quote_char} ? (@{$_[0]->{quote_char}}) : ( ($_[0]->{quote_char}) x 2 ) )
add_drop_table => 1,
ignore_constraint_names => 1,
ignore_index_names => 1,
- quote_identifiers => !!$self->sql_maker->_quote_chars,
+ quote_identifiers => $self->sql_maker->_quoting_enabled,
%{$sqltargs || {}}
};
$sqltargs->{parser_args}{sources} = delete $sqltargs->{sources}
if exists $sqltargs->{sources};
- $sqltargs->{quote_identifiers}
- = !!$self->sql_maker->_quote_chars
- if ! exists $sqltargs->{quote_identifiers};
+ $sqltargs->{quote_identifiers} = $self->sql_maker->_quoting_enabled
+ unless exists $sqltargs->{quote_identifiers};
my $tr = SQL::Translator->new(
producer => "SQL::Translator::Producer::${type}",
# Check deployment statements ctx sensitivity
{
- my $schema = DBICTest->init_schema (no_deploy => 1);
+ my $schema = DBICTest->init_schema (no_deploy => 1, quote_names => 1);
my $not_first_table_creation_re = qr/CREATE TABLE "fourkeys_to_twokeys"/;
my $statements = $schema->deployment_statements;
# there ought to be more code like this in the wild
like(
DBICTest::Schema->connect->deployment_statements('SQLite'),
- qr/\bCREATE TABLE\b/i
+ qr/\bCREATE TABLE artist\b/i # ensure quoting *is* disabled
);
lives_ok( sub {