Vitor Serra Mori > SQLite-DB-0.01 > SQLite::DB

Download:
SQLite-DB-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.01   Source   Latest Release: SQLite-DB-0.04

NAME ^

SQLite::DB provides an object oriented wrapper to SQLite databases using DBI and DBD::SQLite modules.

SYNOPSIS ^

 use SQLite::DB;

 my $db = SQLite::DB->new('file');

 $db->connect;

 $db->select("select * from table where field = value") || print $db->get_error."\n";

 $db->select("select * from table where field = ?","value") || print $db->get_error."\n";

 $db->select("select * from table where field = ?","value") || print $db->get_error."\n";

 $result = $db->select_one_row("select max(field) as total FROM table");

 print $$result{TOTAL};

 $db->transaction_mode;

 $db->exec("INSERT (a,b,c) VALUES 'a','b','c'");
 $db->exec("INSERT (a,b,c) VALUES ?,?,?",'a','b','c');
 $db->exec("update table set field = value") || print $db->get_error."\n";

 $db->commit || print $db->get_error."\n";
 $db->rollback || print $db->get_error."\n";

 my $resultset = $db->get_dblist("select * from table","display_field","keyfield");

 if (!ref $resultset) {
   print $db->get_error."\n"
 } else {
   for (@$resultset) {
     print $resultset->[$_]->{id}." - ".$resultset->[$_]->{value}."\n";
   }
 }

 $db->disconnect;

DESCRIPTION ^

The goal is provide simple coding style to interact with SQLite databases.

Functions

EXPORT_OK ^

w2n

KNOWN BUGS ^

None.

AUTHOR ^

Vitor Serra Mori <vvvv767@hotmail.com.>

COPYRIGHT ^

This package is free software. Tou can redistribute and/or modify it under the same terms as Perl itself.

# }}}