ORLite::Array - Array based objects for ORLite
# Used like the regular ORLite: package Foo; # Simplest possible usage. See documentation for ORlite for advanced usage. use ORLite::Array 'data/sqlite.db'; my @awesome = Foo::Person->select( 'where first_name = ?', 'Adam', ); # Or used with extensions: package Foo; use ORLite::Array (); use ORLite::Mirror 'http://myserver/path/mydb.sqlite';
ORLite is a light weight ORM specifically designed for used with SQLite databases. By changing ORLite's hash based objects to using array based objects we can cut away some time spend in DBI slicing the objects.
For some sample examples this has show the average time spend in the select() method going from 350 µs/call to 160 µs/call.
THIS FEATURE IS EXPERIMENTAL AND SUBJECT TO CHANGE WITHOUT NOTICE
Encapsulation isn't a goal. With ORLite you were able to access the individual keys of the hash. This isn't an usable posibility with array based objects. As an alternative ORLite::Array marks accessors for non foreign key fields as lvalue methods. This makes it possible to update attributes this way:
my $person = Foo::Person->select( 'where id = ?', 42 ); $person->age++; $person->weigth += 10;
- Support for updating foreign key fields
This code is compatible with ORLite version 1.28
Bugs should be reported via the CPAN bug tracker at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ORLite-Array
For other issues, contact the author.
Peter Makholm <peter@makholm.net>
ORLite
Copyright 2008 - 2009 Adam Kennedy. 2009 Peter Makholm
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'µs/call'. Assuming CP1252
To install ORLite::Array, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ORLite::Array
CPAN shell
perl -MCPAN -e shell install ORLite::Array
For more information on module installation, please visit the detailed CPAN module installation guide.