1 package SQL::Translator::Generator::DDL::SQLite;
5 SQL::Translator::Generator::DDL::SQLite - A Moo based SQLite DDL generation
10 I<documentation volunteers needed>
16 has quote_chars => (is=>'ro', default=>sub { +[qw(" ")] } );
18 with 'SQL::Translator::Generator::Role::Quote';
19 with 'SQL::Translator::Generator::Role::DDL';
30 sub _build_sizeless_types {
36 sub _build_numeric_types {
44 'unsigned big int' => 1,
52 'double precision' => 1,
57 sub _build_unquoted_defaults {
61 CURRENT_TIMESTAMP => 1,
68 my ($self, $field) = @_;
70 my $pk = $field->table->primary_key;
71 my @pk_fields = $pk ? $pk->fields : ();
73 $field->is_primary_key && scalar @pk_fields == 1 &&
74 ( $field->data_type =~ /int(eger)?$/i
76 ( $field->data_type =~ /^number?$/i && $field->size !~ /,/ ) )
80 my ($self, $field) = @_;
84 ($field->extra->{auto_increment_type}||'') eq 'monotonic'
88 $field->is_auto_increment
96 my ($self, $field) = @_;
100 $self->field_comments($field),
101 $self->field_name($field),
102 ( $self->_ipk($field)
103 ? ( 'INTEGER PRIMARY KEY' )
104 : ( $self->field_type($field) )
106 ( $self->field_autoinc($field) || () ),
107 $self->field_nullable($field),
108 $self->field_default($field, {
111 'CURRENT_TIMESTAMP' => 1,
119 See the included AUTHORS file:
120 L<http://search.cpan.org/dist/SQL-Translator/AUTHORS>
124 Copyright (c) 2012 the SQL::Translator L</AUTHORS> as listed above.
128 This code is free software and may be distributed under the same terms as Perl