package SQL::Translator::Generator::Role::DDL;
-# AUTHOR: Arthur Axel fREW Schmidt
-# Copyright: Same as Perl 5
+=head1 NAME
+
+SQL::Translator::Generator::Role::DDL - Role implementing common parts of
+DDL generation.
+
+=head1 DESCRIPTION
+
+I<documentation volunteers needed>
+
+=cut
use Moo::Role;
use SQL::Translator::Utils qw(header_comment);
requires '_build_unquoted_defaults';
requires '_build_sizeless_types';
requires 'quote';
+requires 'quote_string';
has type_map => (
is => 'lazy',
if (ref $default) {
$default = $$default;
} elsif (!($self->numeric_types->{lc($field->data_type)} && Scalar::Util::looks_like_number ($default))) {
- $default = "'$default'";
+ $default = $self->quote_string($default);
}
return ( "DEFAULT $default" )
}
sub header_comments { header_comment() . "\n" if $_[0]->add_comments }
1;
+
+=head1 AUTHORS
+
+See the included AUTHORS file:
+L<http://search.cpan.org/dist/SQL-Translator/AUTHORS>
+
+=head1 COPYRIGHT
+
+Copyright (c) 2012 the SQL::Translator L</AUTHORS> as listed above.
+
+=head1 LICENSE
+
+This code is free software and may be distributed under the same terms as Perl
+itself.
+
+=cut