Alzabo
view release on metacpan or search on metacpan
lib/Alzabo/QuickRef.pod view on Meta::CPAN
This reference is intended to provide a quick reference to I<some> of
the more commonly used methods that Alzabo provides. In addition,
this reference can give you an idea of what classes contain certain
I<types> of methods, so you have an idea of where to look in order to
figure out how to achieve a certain task.
=head2 Alzabo, Alzabo::Create, and Alzabo::Runtime
These modules are mostly used just to load other modules. The
C<Alzabo::Runtime> module can be used to preload schemas at compile
time by doing:
use Alzabo::Runtime qw( schema1 schema2 schema3 );
=head2 Alzabo::MethodMaker
This module can be used to generate many useful convenience methods.
This is done by auto-generating methods in new packages and
re-blessing some of the schema objects into these packages. To have
it generate all the possible methods for a schema you would do:
use Alzabo::MethodMaker ( schema => 'some_schema',
# Root for new packages
class_root => 'My::Data',
# Make all possible methods
all => 1 );
This will make convenience methods for such things as getting table
and column objects, following various types of foreign keys, and
getting data from row objects.
=head1 METHODS
=head2 Retrieving data
=head3 Alzabo::Runtime::Schema
This object allows you to connect to the database. It contains
several data retrieval methods including
L<C<join>|Alzabo::QuickRef/join>.
=over 4
=item * load_from_file
=for html_docs type=class
Load an existing schema object from disk. Returns a new schema
object.
=for html_docs link=L<More|Alzabo::Create::Schema/load_from_file($name)>
=item * set_user ($user)
=for html_docs type=object
Set the username to be used when connecting to the database.
=for html_docs link=L<More|Alzabo::Runtime::Schema/set_user ($user)>
=item * set_password ($password)
=for html_docs type=object
Set the password to be used when connecting to the database.
=for html_docs link=L<More|Alzabo::Runtime::Schema/set_password ($password)>
=item * set_host ($host)
=for html_docs type=object
Set the host to be used when connecting to the database.
=for html_docs link=L<More|Alzabo::Runtime::Schema/set_host ($host)>
=item * connect (%params)
=for html_docs type=object
Connect to the RDBMS. This will use the previously set
username/password/host, though these can be overridden by the
C<%params> given to the call.
B<Important>: This method must be called before any data retrieval is
attempted.
=for html_docs link=L<More|Alzabo::Runtime::Schema/connect (%params)>
=item * join
=for html_docs type=object
Fetch rows from one or more tables based on a table join. Returns
either a L<C<Alzabo::Runtime::RowCursor>|Alzabo::Runtime::RowCursor>
or L<C<Alzabo::Runtime::JoinCursor>|Alzabo::Runtime::JoinCursor>
object.
=for html_docs link=L<More|Alzabo::Runtime::Schema/join>
=item * function/select
=for html_docs type=object
Allows you to execute arbitrary column aggregate SQL functions such as
C<AVG> or C<MAX> with a multi-table join.
=for html_docs link=L<More|Alzabo::Runtime::Schema/function and select>
=item * table ($name)
=for html_docs type=object
Returns an L<C<Alzabo::Runtime::Table>|Alzabo::Runtime::Table> object.
This is important because most of the row fetching operations are
table object methods.
=for html_docs link=L<More|Alzabo::Runtime::Schema/table ($name)>
=back
=head3 Alzabo::Runtime::Table
Objects in this class have methods allowing you to insert new rows as
well as retrieving exist data in the form of
L<C<Alzabo::Runtime::Row>|Alzabo::Runtime::Row> or
L<C<Alzabo::Runtime::RowCursor>|Alzabo::Runtime::RowCursor> objects.
All methods that return a single row return an
L<C<Alzabo::Runtime::Row>|Alzabo::Runtime::Row> object.
All methods that return multiple rows return an
L<C<Alzabo::Runtime::RowCursor>|Alzabo::Runtime::RowCursor> object.
All methods that return rows can be given the C<no_cache> parameter,
which ensures that the row(s) returned will not be cached. Rows
obtained in this manner should not be updated or deleted, as this will
play havoc with the caching system. See the
L<C<Alzabo::Runtime::Row>|Alzabo::Runtime::Row> documentation for more
details.
All methods that return multiple rows in the form of a cursor object
( run in 0.658 second using v1.01-cache-2.11-cpan-5a3173703d6 )