On Sun, Oct 21, 2001 at 03:12:01PM -0700, Jason W May wrote:
> I'm working on a module that I hope will provide a similar function for SQL
> code that the various templating modules provide for HTML generation.
>
> The goal is to move SQL code entirely out of the Perl, and to provide a very
> straightforward means of executing the SQL statements that are maintained in
> separate files.
>
> e.g. given this SQL statement in a file named "lookup_employee":
>
> select name,
> salary,
> hire_date
> from EMPLOYEE
> where id = :id
>
> The module works like this:
>
> my $thingy = new Thingy;
> my $data = { id => 473 };
> $thingy->execute("lookup_employee", $data);
> print "Employee $data->{id} is $data->{name} with salary $data->{salary}\n";
Having some kind of 'prepare' concept would make it faster for repetative queries.
> What is an appropriate module name for this package? I'm unclear on the
> rules regarding use of the various db-related namespaces on CPAN.
>
> Some ideas:
> DBIx::Template
> DBI::Template
> SQL::Template
> DBIx::SQLManager
Manager is fairly meaningless really. Template is better but too generic for
such a specific module. Best to use two words. Library could be one of them.
And certainly check out Class::Phrasebook::SQL and maybe work with the author
to extend it if practical.
Tim.