[jifty-devel] Jifty::DBI manpage buglet and a candidate for a FAQ

Andreas J. Koenig andreas.koenig.7os6VVqR at franz.ak.mind.de
Mon May 21 20:43:15 EDT 2007


I have completed the Jifty::Manual::Tutorial and after that I had the
desire to see the content of the database with Jifty's own means, not
in the browser but in perl. So I took the Synopsis of the
Jifty::DBI::Collection manpage and adjusted the filename and tried to
guess the rest. Apparently the manpage has the capitalization wrong? I
then did adjust the driver and database parameters to lowercase but I
could not figure out how to use Jifty::DBI directly. I won't bother
you with all the wrong solutions I tried:-/

Can somebody post a solution?

% /home/src/perl/repoperls/installed-perls/*/p*/perl-5.*@31162/bin/perl -le '      

  use Jifty::DBI::Collection;

  package MyWeblog::Record;
  use base qw/Jifty::DBI::Collection/;

  package main;

  use Jifty::DBI::Handle;
  my $handle = Jifty::DBI::Handle->new();
  $handle->connect( Driver => "SQLite", Database => "myweblog" );

  my $sb = MyWeblog::Record->new( handle => $handle );

  $sb->limit( column => "column_1", value => "matchstring" );

  while ( my $record = $sb->next ) {
      print $record->my_column_name();
  }
'
Can't connect to data source 'Database=myweblog;Driver=SQLite' because I can't work out what driver to use (it doesn't seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env var is not set) at /home/src/perl/repoperls/installed-perls/maint-5.8/pyVlEUy/perl-5.8.0 at 31162/lib/site_perl/5.8.8/Jifty/DBI/Handle.pm line 108



-- 
andreas


More information about the jifty-devel mailing list