Доброго всем
¡ ¡ ¡ ALL GLORY TO GLORIA ! ! !
Mojo::Pg::Che::Database - mix of parent Mojo::Pg::Database and DBI.pm
See also Mojo::Pg::Database#SYNOPSIS
my $db = $pg->db; # DBI style my $now = $db->selectrow_hashref('select now() as now')->{now}; $db->select('select pg_sleep(?::int), now() as now', undef, 2, $cb); Mojo::IOLoop->start; $now = $$cb->()->fetchrow_hashref;
See also Mojo::Pg::Che#Transaction-syntax.
eval { $db->begin; $db->query('insert into foo (name) values (?)', 'bar'); $db->do('insert into foo (name) values (?)', 'baz'); $db->commit; }; die $@ if $@; $db->begin; $db->do('insert into foo (name) values (?)', 'bazzzz'); $db->rollback; $db->begin; $db->query('insert into foo (name) values (?)', 'barrr'); $db->commit;
See Mojo::Pg::Che#Non-blocking-query-cases.
All methods from parent module Mojo::Pg::Database are inherits and implements the following new ones.
Prepare and return DBI statement handler for query string. See DBI#prepare.
Prepare and return DBI cached statement handler for query string. See DBI#prepare_cached.
DBI style quering. See DBI#selectrow_array. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
DBI style quering. See DBI#selectrow_arrayref. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
DBI style quering. See DBI#selectrow_hashref. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
DBI style quering. See DBI#selectall_arrayref. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
DBI style quering. See DBI#selectall_hashref. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
DBI style quering. See DBI#selectcol_arrayref. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
DBI style quering. See DBI#do. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
Start transaction for given object which attr {tx} is a Mojo::Pg::Transaction object. Sinonyms are: ->tx and ->begin_work.
{tx}
->tx
->begin_work
Commit transaction and drop attr {tx} for destroing Mojo::Pg::Transaction object.
Rollback transaction and drop attr {tx} for destroing Mojo::Pg::Transaction object.
The methods select..., do has next input params:
select...
do
String query | statement handler object
Hashref attrs (optional)
Array of bind values (optional)
Callback non-blocking (optional)
Михаил Че (Mikhail Che), <mche[-at-]cpan.org>
<mche[-at-]cpan.org>
Please report any bugs or feature requests at https://github.com/mche/Mojo-Pg-Che/issues. Pull requests also welcome.
Copyright 2016 Mikhail Che.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mojo::Pg::Che, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojo::Pg::Che
CPAN shell
perl -MCPAN -e shell install Mojo::Pg::Che
For more information on module installation, please visit the detailed CPAN module installation guide.