WalaWiki content from p1k3.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

  1. Some notes for a little web app. Also look at [September 8 2007].
  2. * CGI::Application::Plugin::DBH
  3. * CGI::Application::Plugin::Redirect
  4. * CGI::Application::Plugin::Session
  5. * CGI::Application::Plugin::AutoRunmode
  6. * CGI::Application::Plugin::Authentication
  7. * CGI::Application::Plugin::TT
  8. * DBI
  9. * DBD::SQLite
  10. * SQL::Abstract
  11. * [http://search.cpan.org/dist/Class-Accessor/lib/Class/Accessor.pm Class::Accessor]
  12. = SQLite =
  13. I was having mysterious issues using DBI and DBD::SQLite; certain placeholders simply weren't being replaced when using:
  14. my $sth = $dbh->prepare($stmt);
  15. $sth->execute(@bind);
  16. 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:
  17. use DBI qw(:sql_types);
  18. my $sth = $dbh->prepare($stmt);
  19. my $i = 1;
  20. for my $p (@bind) {
  21. $sth->bind_param($i, $p, SQL_INTEGER);
  22. $i++;
  23. }
  24. $sth->execute;
  25. Everything I'm binding is actually an integer; you'd want to be more discerning for the general case.
  26. = general observations =
  27. ORM is a hard problem.