[jifty-devel] Jifty::DBI manpage buglet and a candidate for a FAQ
Thomas Sibley
trs at bestpractical.com
Tue May 22 14:47:11 EDT 2007
Andreas J. Koenig wrote:
> 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?
See the Cookbook ("Reuse Jifty models and actions outside of a Jifty app"):
http://search.cpan.org/~jesse/Jifty/lib/Jifty/Manual/Cookbook.pod#Reuse_Jifty_models_and_actions_outside_of_a_Jifty_app
Tom
> % /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
>
>
>
More information about the jifty-devel
mailing list