the sqlt test suite is good :)

Create table schema manually from description

#!/usr/bin/perl -- use strict; use warnings; #~ http://cpansearch.perl.org/src/JROBINSON/SQL-Translator-0.11010/t/4 +7postgres-producer.t use SQL::Translator::Schema::Table; use SQL::Translator::Producer::PostgreSQL; my $table = SQL::Translator::Schema::Table->new( name => 'urls' ); #~ column_name | data_type #~ -----------------+------------------- my %columnType = map { split /\s+\|\s+/, $_ } split /[\r\n]+/, <<'__COL_TYPE__'; date_checked | date http_code | integer base_uri | text host_alive | boolean last_check_good | boolean count_fails | integer count_success | integer pri | boolean url | text table_id | integer tbl | character varying id | integer __COL_TYPE__ while( my( $name, $type ) = each %columnType ){ my $field = SQL::Translator::Schema::Field->new( name => $name, table => $table, data_type => $type, ); $table->add_field( $field ); } #~ use Data::Dump ; dd SQL::Translator::Producer::PostgreSQL::create_t +able($table) ; my( $sql, $rest ) = SQL::Translator::Producer::PostgreSQL::create_tabl +e($table); print "$sql;\n\n"; __END__ -- -- Table: urls -- CREATE TABLE urls ( tbl character varying, url text, id integer, host_alive boolean, count_fails integer, base_uri text, pri boolean, http_code integer, date_checked date, count_success integer, table_id integer, last_check_good boolean );

and sqlt doesn't appear to miss anything either

output from sqlt -f PostgreSQL -t DBIx::Class::File --prefix=EDINA::ORI < in > out

package EDINA::ORI::urls; use base 'DBIx::Class'; use strict; use warnings; __PACKAGE__->load_components(qw/ Core/); __PACKAGE__->table('urls'); __PACKAGE__->add_columns( 'tbl' => { 'data_type' => 'varchar', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'tbl', 'is_nullable' => 1, 'size' => 0 }, 'url' => { 'data_type' => 'text', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'url', 'is_nullable' => 1, 'size' => '64000' }, 'id' => { 'data_type' => 'integer', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'id', 'is_nullable' => 1, 'size' => '10' }, 'host_alive' => { 'data_type' => 'boolean', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'host_alive', 'is_nullable' => 1, 'size' => 0 }, 'count_fails' => { 'data_type' => 'integer', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'count_fails', 'is_nullable' => 1, 'size' => '10' }, 'base_uri' => { 'data_type' => 'text', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'base_uri', 'is_nullable' => 1, 'size' => '64000' }, 'pri' => { 'data_type' => 'boolean', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'pri', 'is_nullable' => 1, 'size' => 0 }, 'http_code' => { 'data_type' => 'integer', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'http_code', 'is_nullable' => 1, 'size' => '10' }, 'date_checked' => { 'data_type' => 'date', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'date_checked', 'is_nullable' => 1, 'size' => 0 }, 'count_success' => { 'data_type' => 'integer', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'count_success', 'is_nullable' => 1, 'size' => '10' }, 'table_id' => { 'data_type' => 'integer', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'table_id', 'is_nullable' => 1, 'size' => '10' }, 'last_check_good' => { 'data_type' => 'boolean', 'is_auto_increment' => 0, 'default_value' => undef, 'is_foreign_key' => 0, 'name' => 'last_check_good', 'is_nullable' => 1, 'size' => 0 }, ); package EDINA::ORI; use base 'DBIx::Class::Schema'; use strict; use warnings; __PACKAGE__->register_class('urls', 'EDINA::ORI::urls'); 1;

Is this a bug in dbicdump ? I can't tell :)


In reply to Re^2: dbicdump not importing the full table (Postgres) by Anonymous Monk
in thread dbicdump not importing the full table (Postgres) by kiz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.