From: Arthur Axel 'fREW' Schmidt Date: Tue, 24 Jan 2012 23:47:32 +0000 (-0600) Subject: better X-Git-Tag: v0.11011~27^2~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=39bfaa8b6ba856c4a59c1ba8b0cd510e6a736290;p=dbsrgits%2FSQL-Translator.git better --- diff --git a/lib/SQL/Translator/Generator/DDL/SQLServer.pm b/lib/SQL/Translator/Generator/DDL/SQLServer.pm index 4fc4466..7d82eef 100644 --- a/lib/SQL/Translator/Generator/DDL/SQLServer.pm +++ b/lib/SQL/Translator/Generator/DDL/SQLServer.pm @@ -4,9 +4,11 @@ use Moo; use SQL::Translator::Generator::Utils; use SQL::Translator::Schema::Constants; +with 'SQL::Translator::Generator::Role::Quote'; with 'SQL::Translator::Generator::Role::DDL'; -sub _build_shim { SQL::Translator::Generator::Utils->new( quote_chars => [qw( [ ] )] ) } +sub quote_chars { [qw([ ])] } +sub name_sep { q(.) } sub _build_numeric_types { +{ diff --git a/lib/SQL/Translator/Generator/DDL/SQLite.pm b/lib/SQL/Translator/Generator/DDL/SQLite.pm index 96ba086..63c5d42 100644 --- a/lib/SQL/Translator/Generator/DDL/SQLite.pm +++ b/lib/SQL/Translator/Generator/DDL/SQLite.pm @@ -3,9 +3,11 @@ package SQL::Translator::Generator::DDL::SQLite; use Moo; use SQL::Translator::Generator::Utils; +with 'SQL::Translator::Generator::Role::Quote'; with 'SQL::Translator::Generator::Role::DDL'; -sub _build_shim { SQL::Translator::Generator::Utils->new( quote_chars => q(") ) } +sub quote_chars { [qw(" ")] } +sub name_sep { q(.) } sub _build_type_map { +{ diff --git a/lib/SQL/Translator/Generator/Role/DDL.pm b/lib/SQL/Translator/Generator/Role/DDL.pm index 5533a01..6dc0252 100644 --- a/lib/SQL/Translator/Generator/Role/DDL.pm +++ b/lib/SQL/Translator/Generator/Role/DDL.pm @@ -3,17 +3,11 @@ package SQL::Translator::Generator::Role::DDL; use Moo::Role; use SQL::Translator::Utils qw(header_comment); -requires '_build_shim'; requires '_build_type_map'; requires '_build_numeric_types'; requires '_build_unquoted_defaults'; requires 'field_type_size'; - -has shim => ( - is => 'ro', - handles => [ 'quote' ], - builder => '_build_shim', -); +requires 'quote'; has type_map => ( is => 'ro',