|
Class::DBI::SQLite - Extension to Class::DBI for sqlite |
Class::DBI::SQLite - Extension to Class::DBI for sqlite
package Film;
use base qw(Class::DBI::SQLite);
__PACKAGE__->set_db('Main', 'dbi:SQLite:dbname=dbfile', '', '');
__PACKAGE__->set_up_table('Movies');
package main;
my $film = Film->create({
name => 'Bad Taste',
title => 'Peter Jackson',
});
my $id = $film->id; # auto-incremented
Class::DBI::SQLite is an extension to Class::DBI for DBD::SQLite, which allows you to populate auto incremented row id after insert.
set_up_table method allows you to automate the setup of columns and
primary key by using of SQLite PRAGMA statement (with SQL::Statement
module)
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
set_up_table implementation by Tomohiro Ikebe <ikebe@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
the Class::DBI manpage, the DBD::SQLite manpage the SQL::Statement manpage
|
Class::DBI::SQLite - Extension to Class::DBI for sqlite |