« blib/lib/blx/xsdsql/schema_repository/sql/pg/binding.pm
↑ Summary
blib/lib/blx/xsdsql/xsd_parser/node/sequence.pm »
| 1 | package blx::xsdsql::generator::sql::generic::handle::create_extra_tables; | ||
| 2 | use strict; # use strict is for PBP | ||
| 3 | use Filter::Include; | ||
| 4 | include blx::xsdsql::include; | ||
| 5 | #line 6 | ||
| 6 | use blx::xsdsql::schema_repository::sql::generic::column; | ||
| 7 | use base(qw(blx::xsdsql::generator::sql::generic::handle)); | ||
| 8 | |||
| 9 | sub _get_create_prefix { | ||
| 10 | my ($self,%params)=@_; | ||
| 11 | return "create table"; | ||
| 12 | } | ||
| 13 | |||
| 14 | sub table_header { | ||
| 15 | my ($self,$dic,%params)=@_; | ||
| 16 | my $comment=$params{NO_EMIT_COMMENTS} ? '' : $dic->get_comment; | ||
| 17 | $self->{STREAMER}->put_line($self->_get_create_prefix,' ',$dic->get_sql_name,"( ",$comment); | ||
| 18 | for my $col($dic->get_columns) { | ||
| 19 | my $first_column=$col->get_attrs_value(qw(COLUMN_SEQUENCE)) == 0 ? 1 : 0; | ||
| 20 | my $comment=$params{NO_EMIT_COMMENTS} ? '' : $col->get_comment; | ||
| 21 | $self->{STREAMER}->put_line("\t".($first_column ? '' : ',').$col->get_sql_name."\t".$col->get_sql_type."\t".$comment); | ||
| 22 | } | ||
| 23 | $self->{STREAMER}->put_line(')',$dic->command_terminator); | ||
| 24 | $self->{STREAMER}->put_line; | ||
| 25 | $self->_create_indexes($dic,%params); | ||
| 26 | return $self; | ||
| 27 | } | ||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | 1; | ||
| 32 | |||
| 33 | __END__ |