ActiveRecord-Simple
view release on metacpan or search on metacpan
Person->find->limit(3);
Person->find->offset(10);
Person->find->limit(3)->offset(12);
Left joins:
my $person = Person->find->with('misc_info')->fetch;
print $person->name;
print $person->misc_info->zip;
And, of course, all of this together:
my $new_customer =
Person->find
->only('name')
->order_by('date_register')
->desc
->limit(1)
->with('misc_info', 'payment_info')
->fetch;
print $new_customer->name;
print $new_customer->misc_info->zip;
print $new_customer->payment_info->last_payment;
Also one-to-one, one-to-many, many-to-one and many-to-many relations, smart_saving and even more.
And, of course, you don't need use "table_name", "primary_key" etc. Just use this:
__PACKAGE__->load_info(); ### All info will be loaded from database automatically.
Check it out!
INSTALLATION
============
To install this module, run the following commands:
$ perl Makefile.PL
$ make
$ make test
$ make install
or:
$ sudo cpan ActiveRecord::Simple
SUPPORT AND DOCUMENTATION
=========================
After installing, you can find documentation for this module with the
perldoc command.
perldoc ActiveRecord::Simple
Feel free to join us at google groups:
https://groups.google.com/forum/#!forum/activerecord-simple
Also the github page:
http://shootnix.github.io/activerecord-simple/
LICENSE AND COPYRIGHT
=====================
Copyright (C) 2013-2018 shootnix
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
CREDITS
=======
@shootnix
@kberov
@chorny
@lifeofguenter
@neilbowers
@dsteinbrunner
@reindeer
@grinya007
( run in 0.583 second using v1.01-cache-2.11-cpan-df04353d9ac )