Some notes for a little web app. Also look at [September 8 2007].
|
|
|
|
* CGI::Application::Plugin::DBH
|
|
* CGI::Application::Plugin::Redirect
|
|
* CGI::Application::Plugin::Session
|
|
* CGI::Application::Plugin::AutoRunmode
|
|
* CGI::Application::Plugin::Authentication
|
|
* CGI::Application::Plugin::TT
|
|
|
|
* DBI
|
|
* DBD::SQLite
|
|
* SQL::Abstract
|
|
|
|
* [http://search.cpan.org/dist/Class-Accessor/lib/Class/Accessor.pm Class::Accessor]
|
|
|
|
= SQLite =
|
|
|
|
I was having mysterious issues using DBI and DBD::SQLite; certain placeholders simply weren't being replaced when using:
|
|
|
|
my $sth = $dbh->prepare($stmt);
|
|
$sth->execute(@bind);
|
|
|
|
In the end I'm still not sure why, or whether the weirdness lives specifically in DBD::SQLite or sqlite itself, but after much googling, I wound up just doing this instead:
|
|
|
|
use DBI qw(:sql_types);
|
|
|
|
my $sth = $dbh->prepare($stmt);
|
|
|
|
my $i = 1;
|
|
for my $p (@bind) {
|
|
$sth->bind_param($i, $p, SQL_INTEGER);
|
|
$i++;
|
|
}
|
|
|
|
$sth->execute;
|
|
|
|
Everything I'm binding is actually an integer; you'd want to be more discerning for the general case.
|
|
|
|
= general observations =
|
|
|
|
ORM is a hard problem.
|