-
-
04 Feb 2019 07:03:45 UTC
- Distribution: Mojo-Pg-Che
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (2)
- Testers (90 / 18 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (18.44KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
++ed by:1 non-PAUSE userand 1 contributors- ÐÐ¸Ñ Ð°Ð¸Ð» Че (Mikhail Che) <mche[-at-]cpan.org>
- Dependencies
- Mojo::Pg
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- Mojo::Pg::Che::Database
- NAME
- SYNOPSIS
- Non-blocking query cases
- METHODS
- Params for quering methods
- AUTHOR
- BUGS / CONTRIBUTING
- COPYRIGHT
Доброго всем
Mojo::Pg::Che::Database
¡ ¡ ¡ ALL GLORY TO GLORIA ! ! !
NAME
Mojo::Pg::Che::Database - mix of parent Mojo::Pg::Database and DBI.pm
SYNOPSIS
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;
Transaction syntax
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;
Non-blocking query cases
See Mojo::Pg::Che#Non-blocking-query-cases.
METHODS
All methods from parent module Mojo::Pg::Database are inherits and implements the following new ones.
prepare
Prepare and return DBI statement handler for query string. See DBI#prepare.
prepare_cached
Prepare and return DBI cached statement handler for query string. See DBI#prepare_cached.
selectrow_array
DBI style quering. See DBI#selectrow_array. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
selectrow_arrayref
DBI style quering. See DBI#selectrow_arrayref. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
selectrow_hashref
DBI style quering. See DBI#selectrow_hashref. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
selectall_arrayref
DBI style quering. See DBI#selectall_arrayref. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
selectall_hashref
DBI style quering. See DBI#selectall_hashref. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
selectcol_arrayref
DBI style quering. See DBI#selectcol_arrayref. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
do
DBI style quering. See DBI#do. Blocking | non-blocking. Input params - Mojo::Pg::Che::Database#Params-for-quering-methods.
begin
Start transaction for given object which attr
{tx}
is a Mojo::Pg::Transaction object. Sinonyms are:->tx
and->begin_work
.commit
Commit transaction and drop attr
{tx}
for destroing Mojo::Pg::Transaction object.rollback
Rollback transaction and drop attr
{tx}
for destroing Mojo::Pg::Transaction object.Params for quering methods
The methods
select...
,do
has next input params:String query | statement handler object
Hashref attrs (optional)
Array of bind values (optional)
Callback non-blocking (optional)
AUTHOR
Михаил Че (Mikhail Che),
<mche[-at-]cpan.org>
BUGS / CONTRIBUTING
Please report any bugs or feature requests at https://github.com/mche/Mojo-Pg-Che/issues. Pull requests also welcome.
COPYRIGHT
Copyright 2016 Mikhail Che.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Mojo::Pg::Che, copy and paste the appropriate command in to your terminal.
cpanm Mojo::Pg::Che
perl -MCPAN -e shell install Mojo::Pg::Che
For more information on module installation, please visit the detailed CPAN module installation guide.