DBIx-Mint
view release on metacpan or search on metacpan
lib/DBIx/Mint.pm view on Meta::CPAN
Class method. It fetches an instance of L<DBIx::Mint> from the object pool:
my $mint = DBIx::Mint->instance; # Default connection
my $mint2 = DBIx::Mint->instance('other'); # 'other' connection
If the object does not exist, it will be created and so this is the third constructor. This method allows you to create mappings to different databases in the same program. The optional argument is used as the DBIx::Mint object name.
=head2 connector
This accessor/mutator will return the underlying L<DBIx::Connector> object.
=head2 dbh
This method will return the underlying database handle, which is guaranteed to be alive.
=head2 abstract
This is the accessor/mutator for the L<SQL::Abstract::More> subjacent object.
=head2 schema
This is the accessor/mutator for the L<DBIx::Mint::Schema> instance.
=head2 do_transaction
This instance method will take a code reference and execute it within a transaction block. In case the transaction fails (your code dies) it is rolled back and B<a warning is thrown>. In this case, L<do_transaction> will return C<undef>. If successfu...
$mint->do_transaction( $code_ref ) || die "Transaction failed!";
Note that it must be called as an intance method, not as a class method.
=head1 USE OF L<DBIx::Connector>
Under the hood, DBIx::Mint uses DBIx::Connector to hold the database handle and to make sure that the connection is well and alive when you need it. The database modification routines employ the 'fixup' mode for modifying the database at a very fine-...
The query routines offered by L<DBIx::Mint::ResultSet> use the 'fixup' mode while retrieving the statement holder with the SELECT query already prepared, but not while extracting information in the execution phase. If you fear that the database conne...
=head1 DEPENDENCIES
This distribution depends on the following external, non-core modules:
=over
=item Moo
=item MooX::Singleton
=item SQL::Abstract::More
=item DBI
=item DBIx::Connector
=item List::MoreUtils
=item Clone
=back
=head1 BUGS AND LIMITATIONS
Testing is not complete; in particular, tests look mostly for the expected results and not for edge cases or plain incorrect input.
Please report problems to the author. Patches are welcome. Tests are welcome also.
=head1 ACKNOWLEDGEMENTS
The ResultSet class was inspired by L<DBIx::Lite>, by Alessandro Ranellucci.
=head1 AUTHOR
Julio Fraire, <julio.fraire@gmail.com>
=head1 LICENCE AND COPYRIGHT
Copyright (c) 2015, Julio Fraire. All rights reserved.
=head1 LICENSE
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
=cut
( run in 1.112 second using v1.01-cache-2.11-cpan-ceb78f64989 )