On Monday 22 October 2001 05:50 am, Tim Bunce wrote: > On Sun, Oct 21, 2001 at 03:12:01PM -0700, Jason W May wrote: > >... > > 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.
My goal is to reduce things down to the absolute minimum. On first execute() of a given SQL template, it will be prepared, and the statement handle cached. The cached handle will be reused on subsequent executes. Bind variables will come from the input hash each time. I need to deal with the case where the database limits the number of concurrent handles. Some sort of LRU strategy should work for this. > > 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. DBIx::TemplateLibrary? It's definitely intended to allow teams to build repositories of shared SQL code. -Jason