ORLite

ORLite ist ein „leichtgewichtiger“ ORM speziell für SQLite. (im CPAN suchen)

package Foo;

# Simplest possible usage

use strict;
use ORLite 'data/sqlite.db';

my @awesome = Foo::Person->select(
   'where first_name = ?',
   'Adam',
);

package Bar;

# All available options enabled or specified.
# Some options shown are mutually exclusive,
# this code would not actually run.

use ORLite {
    package      => 'My::ORM',
    file         => 'data/sqlite.db',
    user_version => 12,
    readonly     => 1,
    create       => sub {
        my $dbh = shift;
        $dbh->do('CREATE TABLE foo ( bar TEXT NOT NULL )');
    },
    tables       => [ 'table1', 'table2' ],
    cleanup      => 'VACUUM',
    prune        => 1,
);