Date: | Fri, 10 Oct 2003 22:03:57 -0700 |
From: | Michael G Schwern <schwern [...] pobox.com> |
To: | cdbi-talk [...] groups.kasei.com, tmtm [...] cpan.org |
Subject: | [PATCH] Class::DBI::mysql create & drop_table() |
I've found myself almost always writing create_table() and drop_table()
in my Class::DBI apps. I usually do something like:
Foo::Bar->create_table('foobar', q{
foo INTEGER PRIMARY KEY NOT NULL,
bar CHAR(23)
});
Foo::Bar->set_up_table('foobar');
I've attached a patch for create_table() and drop_table() in
Class::DBI::mysql. I've noticed that even the Class::DBI::mysql tests
implement almost exactly the same functions! :)
If it works out in Class::DBI::mysql it may be worth considering for
Class::DBI. It can be made portable pretty easily.
I also fixed a few doc typos (using =head1 instead of =head2) and improved
a few nits in the tests: using some more appropriate Test::More methods
and using a loop around create() instead of a raw INSERT.
--
Michael G Schwern schwern@pobox.com http://www.pobox.com/~schwern/
I need a SHOWER a BURGER and some ROBOTS, STAT!
-- http://www.angryflower.com/allrigh.gif
Message body is not shown because sender requested not to inline it.