Plack::Component);
use Plack::Util::Accessor qw( dsn dbh);
use Plack::Request;
use JSON::PP qw(encode_json decode_json);
use parent qw(Exporter);
our $VERSION = '0.06';
our @EXPORT = qw(pgrest);
sub
1 ? @_ : dsn => 'dbi:Pg:'.$_[0] )->to_app;
}
# maintain json object field order
use Tie::IxHash;
my $obj_parser_sub = \&JSON::PP::object;
*JSON::PP::object = sub {
tie my %obj, 'Tie::IxHash';
$obj_
$n = shift;
return $n unless $n;
return decode_json $n
}
method select($param, $args) {
use Data::Dumper;
my $req = encode_json({
collection => $args->{collection},
l