ORLite::Array - Array based objects for ORLite


ORLite-Array documentation  | view source Contained in the ORLite-Array distribution.

Index


NAME

Top

ORLite::Array - Array based objects for ORLite

SYNOPSIS

Top

  # 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';




DESCRIPTION

Top

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.

ACCESSORS

Top

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;

THIS FEATURE IS EXPERIMENTAL AND SUBJECT TO CHANGE WITHOUT NOTICE

TODO

Top

- Support for updating foreign key fields

COMPATIBILITY

Top

This code is compatible with ORLite version 1.28

SUPPORT

Top

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.

AUTHOR

Top

Peter Makholm <peter@makholm.net>

SEE ALSO

Top

ORLite

COPYRIGHT

Top


ORLite-Array documentation  | view source Contained in the ORLite-Array distribution.