2 role SQL::Translator::Parser::DDL {
3 use MooseX::Types::Moose qw(HashRef Maybe Str);
4 use SQL::Translator::Types qw(Schema);
5 use SQL::Translator::Constants qw(:sqlt_types);
6 use MooseX::MultiMethods;
9 has 'data_type_mapping' => (
15 has 'schema_name' => (
29 return unless $self->type;
31 my $grammar = 'SQL::Translator::Grammar::' . $self->type;
32 Class::MOP::load_class($grammar);
33 $grammar->meta->apply($self);
35 my $role = __PACKAGE__ . '::' . $self->type;
36 Class::MOP::load_class($role);
37 $role->meta->apply($self);
40 method _build_data_type_mapping {
42 'text' => SQL_LONGVARCHAR(),
43 'timestamp' => SQL_TIMESTAMP(),
44 'timestamp without time zone' => SQL_TYPE_TIMESTAMP(),
45 'timestamp' => SQL_TYPE_TIMESTAMP_WITH_TIMEZONE(),
46 'int' => SQL_INTEGER(),
47 'integer' => SQL_INTEGER(),
48 'character' => SQL_CHAR(),
49 'varchar' => SQL_VARCHAR(),
51 'bigint' => SQL_BIGINT()