remove some debugging cruft, oops
authorivan <ivan>
Wed, 27 Sep 2000 12:25:44 +0000 (12:25 +0000)
committerivan <ivan>
Wed, 27 Sep 2000 12:25:44 +0000 (12:25 +0000)
DBSchema.pm
DBSchema/Table.pm

index 327a0cc..ae82a9b 100644 (file)
@@ -209,9 +209,15 @@ sub pretty_print {
       "'$table' => {\n".
         "  'columns' => [\n".
           join("", map { 
+                         #cant because -w complains about , in qw()
+                         # (also biiiig problems with empty lengths)
+                         #"    qw( $_ ".
+                         #$self->table($table)->column($_)->type. " ".
+                         #( $self->table($table)->column($_)->null ? 'NULL' : 0 ). " ".
+                         #$self->table($table)->column($_)->length. " ),\n"
                          "    '$_', ".
                          "'". $self->table($table)->column($_)->type. "', ".
-                         "'". $self->table($table)->column($_)->null. "', ".
+                         "'". $self->table($table)->column($_)->null. "', ". 
                          "'". $self->table($table)->column($_)->length. "'\n"
                        } $self->table($table)->columns
           ).
@@ -282,7 +288,7 @@ the same terms as Perl itself.
 Each DBIx::DBSchema object should have a name which corresponds to its name
 within the SQL database engine (DBI data source).
 
-pretty_print is atrocious.
+pretty_print is actually pretty ugly.
 
 =head1 SEE ALSO
 
index 56852a4..a05becf 100644 (file)
@@ -112,8 +112,7 @@ column names and attributes *should* work for any database.
 
 sub new_odbc {
   my( $proto, $dbh, $name) = @_;
-  #my $driver = DBIx::DBSchema::_load_driver($dbh);
-  my $driver = DBIx::DBSchema::_load_driver(DBI->connect("dbi:CSV:dbname=testfile", "postgres", ""));
+  my $driver = DBIx::DBSchema::_load_driver($dbh);
   my $sth = _null_sth($dbh, $name);
   my $sthpos = 0;
   $proto->new (
@@ -294,16 +293,16 @@ sub sql_create_table {
     push @columns, map "INDEX ($_)", $self->index->sql_list;
   }
 
-  "CREATE TABLE ". $self->name. " ( ". join(", ", @columns). " )",
+  "CREATE TABLE ". $self->name. " (\n  ". join(",\n  ", @columns). "\n)\n",
   ( map {
     my($index) = $self->name. "__". $_ . "_index";
     $index =~ s/,\s*/_/g;
-    "CREATE UNIQUE INDEX $index ON ". $self->name. " ($_)"
+    "CREATE UNIQUE INDEX $index ON ". $self->name. " ($_)\n"
   } $self->unique->sql_list ),
   ( map {
     my($index) = $self->name. "__". $_ . "_index";
     $index =~ s/,\s*/_/g;
-    "CREATE INDEX $index ON ". $self->name. " ($_)"
+    "CREATE INDEX $index ON ". $self->name. " ($_)\n"
   } $self->index->sql_list ),
   ;