PGObject-Simple-3.000002/0000755000175000017500000000000013117201516013621 5ustar chrischrisPGObject-Simple-3.000002/META.yml0000664000175000017500000000115113117201516015072 0ustar chrischris--- abstract: "Minimalist stored procedure mapper based on LedgerSMB's DBObject" author: - 'Chris Travers ' build_requires: Data::Dumper: '0' Test::More: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005' license: bsd meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: PGObject-Simple no_index: directory: - t - inc requires: PGObject: v1.403.2 version: 3.000002 x_serialization_backend: 'CPAN::Meta::YAML version 0.018' PGObject-Simple-3.000002/Changes0000644000175000017500000000450013117174561015124 0ustar chrischrisRevision history for PGObject-Simple 3.0.2 2016-06-10 Fixed bug introduced during refactoring for byteas 3.0.1 2017-05-20 Fixed a bug where package defaults are never called where they should be 3.0 2017-05-19 Removed support for Perl 5.6 and 5.8 Code cleanup Now provide exports for code re-use in rolls and adaptors Give precedence to functions over hash elements in object mappings. Added getters and setters for dbh Added association interface Added support for package-level reader/factories for param defaults Added support for object accessors for param defaults 2.0.0 2016-11-21 Release version 2.0.0 in order to get out of the 1.9 vs 1.10 mess 1.91 2016-11-21 CPAN won't accept 1.10.1 as it's lower than 1.9... Renumbering 1.10.1 2016-11-21 Fix minimum dependency on PGObject 1.9 2016-11-20 Fix issue #5: Don't call $value->to_db() [PGObject already does] Fix issue #6: Don't special-case BYTEA arguments Fix author tests 1.8 2014-08-21 1. Made use of catalog-lookups memoization-safe. 1.7 2014-08-19 1. Solved a number of issues regarding overriding defaults for application frameworks 1.6 2014-02-24 1. Added per class schema handling (overridden by per call handling). 2. Re-arranged requirements in Makefile.PL 3. DB tests now use DB_TESTING=1 to set on, consistent with other PGObject modules 1.5 2014-02-16 1. Added contextual return handling so that db procedure calls can return either the first row of the set (usually useful where that is the only row) or the full set. 1.4 2013-11-12 1. Fixed __PACKAGE__->call_dbmethod interface so it works. 1.3 2013-06-07 1. Fixed test case that caused thins to bomb 1.2 2013-06-05 1. Added registry support 2. Additional safety checks for database tests 1.1 2013-05-30 1. Added function prefix support. 2. More documentation 1.00 2013-05-26 First version, released on an unsuspecting world. Changes from LedgerSMB's API include: 1. call_procedure uses funcname instead of procname argument 2. main mapper is called call_dbmethod instead of exec_method 3. Fewer assumptions regarding database connection handling PGObject-Simple-3.000002/META.json0000664000175000017500000000176213117201516015252 0ustar chrischris{ "abstract" : "Minimalist stored procedure mapper based on LedgerSMB's DBObject", "author" : [ "Chris Travers " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005", "license" : [ "bsd" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "PGObject-Simple", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "Data::Dumper" : "0", "Test::More" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "PGObject" : "v1.403.2" } } }, "release_status" : "stable", "version" : 3.000002, "x_serialization_backend" : "JSON::PP version 2.27400" } PGObject-Simple-3.000002/Makefile.PL0000644000175000017500000000127713105531745015611 0ustar chrischrisuse 5.010; use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'PGObject::Simple', AUTHOR => q{Chris Travers }, VERSION_FROM => 'lib/PGObject/Simple.pm', ABSTRACT_FROM => 'lib/PGObject/Simple.pm', ($ExtUtils::MakeMaker::VERSION >= 6.3002 ? ('LICENSE'=> 'bsd') : ()), PL_FILES => {}, PREREQ_PM => { 'PGObject' => '1.403.2', }, BUILD_REQUIRES => { 'Test::More' => 0, 'Data::Dumper' => 0, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'PGObject-Simple-*' }, ); PGObject-Simple-3.000002/t/0000755000175000017500000000000013117201516014064 5ustar chrischrisPGObject-Simple-3.000002/t/pod-coverage.t0000644000175000017500000000104713105015211016616 0ustar chrischrisuse strict; use warnings; use Test::More; # Ensure a recent version of Test::Pod::Coverage my $min_tpc = 1.08; eval "use Test::Pod::Coverage $min_tpc"; plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" if $@; # Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, # but older versions don't recognize some common documentation styles my $min_pc = 0.18; eval "use Pod::Coverage $min_pc"; plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" if $@; all_pod_coverage_ok(); PGObject-Simple-3.000002/t/manifest.t0000644000175000017500000000042013105015211016043 0ustar chrischris#!perl -T use strict; use warnings; use Test::More; unless ( $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } eval "use Test::CheckManifest 0.9"; plan skip_all => "Test::CheckManifest 0.9 required" if $@; ok_manifest(); PGObject-Simple-3.000002/t/boilerplate.t0000644000175000017500000000236113105015211016545 0ustar chrischris#!perl -T use 5.006; use strict; use warnings; use Test::More tests => 3; sub not_in_file_ok { my ($filename, %regex) = @_; open( my $fh, '<', $filename ) or die "couldn't open $filename for reading: $!"; my %violated; while (my $line = <$fh>) { while (my ($desc, $regex) = each %regex) { if ($line =~ $regex) { push @{$violated{$desc}||=[]}, $.; } } } if (%violated) { fail("$filename contains boilerplate text"); diag "$_ appears on lines @{$violated{$_}}" for keys %violated; } else { pass("$filename contains no boilerplate text"); } } sub module_boilerplate_ok { my ($module) = @_; not_in_file_ok($module => 'the great new $MODULENAME' => qr/ - The great new /, 'boilerplate description' => qr/Quick summary of what the module/, 'stub function definition' => qr/function[12]/, ); } not_in_file_ok(README => "The README is used..." => qr/The README is used/, "'version information here'" => qr/to provide version information/, ); not_in_file_ok(Changes => "placeholder date/time" => qr(Date/time) ); module_boilerplate_ok('lib/PGObject/Simple.pm'); PGObject-Simple-3.000002/t/02-call_procedure.t0000644000175000017500000000742613105535523017471 0ustar chrischrispackage dbtest; use parent 'PGObject::Simple'; sub dbh { my ($self) = @_; return $self->SUPER::dbh(@_) if ref $self; return $main::dbh; } sub func_prefix { return ''; } sub func_schema { return 'public'; } package main; use PGObject::Simple; use Test::More; use DBI; use Data::Dumper; my %hash = ( foo => 'foo', bar => 'baz', baz => '2', id => '33', ); plan skip_all => 'Not set up for db tests' unless $ENV{DB_TESTING}; plan tests => 11; my $dbh1 = DBI->connect('dbi:Pg:dbname=postgres', 'postgres'); $dbh1->do('CREATE DATABASE pgobject_test_db') if $dbh1; our $dbh = DBI->connect('dbi:Pg:dbname=pgobject_test_db', 'postgres'); $dbh->do(' CREATE FUNCTION public.foobar (in_foo text, in_bar text, in_baz int, in_id int) RETURNS int language sql as $$ SELECT char_length($1) + char_length($2) + $3 * $4; $$; ') if $dbh; $dbh->do('CREATE SCHEMA test;'); $dbh->do(' CREATE FUNCTION test.foobar (in_foo text, in_bar text, in_baz int, in_id int) RETURNS int language sql as $$ SELECT 2 * (char_length($1) + char_length($2) + $3 * $4); $$; ') if $dbh; my $answer = 72; SKIP: { skip 'No database connection', 8 unless $dbh; my $obj = PGObject::Simple->new(%hash); $obj->set_dbh($dbh); my ($ref) = $obj->call_procedure( funcname => 'foobar', args => ['text', 'text2', '5', '30'] ); is ($ref->{foobar}, 159, 'Correct value returned, call_procedure') or diag Dumper($ref); ($ref) = PGObject::Simple->call_procedure( dbh => $dbh, funcname => 'foobar', args => ['text', 'text2', '5', '30'] ); is ($ref->{foobar}, 159, 'Correct value returned, call_procedure, package invocation') or diag Dumper($ref); ($ref) = dbtest->call_procedure(funcname => 'foobar', args => ['text', 'text2', '5', '30'] ); is ($ref->{foobar}, 159, 'Correct value returned, package invocation with factories') or diag Dumper($ref); ($ref) = $obj->call_procedure( funcname => 'foobar', funcschema => 'public', args => ['text1', 'text2', '5', '30'] ); is ($ref->{foobar}, 160, 'Correct value returned, call_procedure w/schema') or diag Dumper($ref); ($ref) = $obj->call_dbmethod( funcname => 'foobar' ); is ($ref->{foobar}, $answer, 'Correct value returned, call_dbmethod') or diag Dumper($ref); ($ref) = PGObject::Simple->call_dbmethod( funcname => 'foobar', args => \%hash, dbh => $dbh, ); is ($ref->{foobar}, $answer, 'Correct value returned, call_dbmethodi with hash and no ref') or diag Dumper($ref); ($ref) = dbtest->call_dbmethod(funcname => 'foobar', args => \%hash ); is ($ref->{foobar}, $answer, 'Correct value returned, package invocation with factories and dbmethod') or diag Dumper($ref); ($ref) = $obj->call_dbmethod( funcname => 'foobar', args => {id => 4} ); is ($ref->{foobar}, 14, 'Correct value returned, call_dbmethod w/args') or diag Dumper($ref); $obj->_set_funcprefix('foo'); ($ref) = ($ref) = $obj->call_dbmethod( funcname => 'bar', args => {id => 4} ); is ($ref->{foobar}, 14, 'Correct value returned, call_dbmethod w/args/prefix') or diag Dumper($ref); ($ref) = ($ref) = $obj->call_dbmethod( funcname => 'oobar', args => {id => 4}, funcprefix => 'f' ); is ($ref->{foobar}, 14, 'Correct value returned, call_dbmethod w/exp. pre.') or diag Dumper($ref); $obj->_set_funcschema('test'); $obj->_set_funcprefix(''); ($ref) = $obj->call_dbmethod( funcname => 'foobar' ); is ($ref->{foobar}, $answer * 2, 'Correct value returned, call_dbmethod') or diag Dumper($ref); $obh = dbtest->new(); } $dbh->disconnect if $dbh; $dbh1->do('DROP DATABASE pgobject_test_db') if $dbh1; $dbh1->disconnect if $dbh1; PGObject-Simple-3.000002/t/01-constructor.t0000644000175000017500000000112513105502213017046 0ustar chrischrisuse PGObject::Simple; use Test::More tests => 5; use DBI; my %hash = ( foo => 'foo', bar => 'baz', baz => '2', id => '33', ); my $dbh = 'test_dbh_fake_value'; my $obj = PGObject::Simple->new(%hash); ok($obj->isa('PGObject::Simple'), 'Object successfully created'); is($obj->set_dbh($dbh), $dbh, 'Set database handle successfully'); is($dbh, $obj->dbh, "database handle cross check"); my $obj2 = PGObject::Simple->new(%hash); is($obj2->dbh, undef, 'No db handle for second object'); $obj2->associate($obj); is($dbh, $obj2->dbh, "database handle cross check after association"); PGObject-Simple-3.000002/t/pod.t0000644000175000017500000000035013105015211015021 0ustar chrischris#!perl -T use strict; use warnings; use Test::More; # Ensure a recent version of Test::Pod my $min_tp = 1.22; eval "use Test::Pod $min_tp"; plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; all_pod_files_ok(); PGObject-Simple-3.000002/t/00-load.t0000644000175000017500000000027013105015211015374 0ustar chrischris#!perl -T use Test::More tests => 1; BEGIN { use_ok( 'PGObject::Simple' ) || print "Bail out!\n"; } diag( "Testing PGObject::Simple $PGObject::Simple::VERSION, Perl $], $^X" ); PGObject-Simple-3.000002/lib/0000755000175000017500000000000013117201516014367 5ustar chrischrisPGObject-Simple-3.000002/lib/PGObject/0000755000175000017500000000000013117201516016024 5ustar chrischrisPGObject-Simple-3.000002/lib/PGObject/Simple.pm0000644000175000017500000003267613117174607017643 0ustar chrischrispackage PGObject::Simple; use 5.010; use strict; use warnings; use Carp; use PGObject; use parent 'Exporter'; =head1 NAME PGObject::Simple - Minimalist stored procedure mapper based on LedgerSMB's DBObject =head1 VERSION Version 3.0.2 =cut our $VERSION = 3.000002; =head1 SYNOPSIS use PGObject::Simple; my $obj = PGObject::Simple->new(%myhash); $obj->set_dbh($dbh); # Database connection To call a stored procedure with enumerated arguments. my @results = $obj->call_procedure( funcname => $funcname, funcschema => $funcname, args => [$arg1, $arg2, $arg3], ); You can add something like a running total as well: my @results = $obj->call_procedure( funcname => $funcname, funcschema => $funcname, args => [$arg1, $arg2, $arg3], running_funcs => [{agg => 'sum(amount)', alias => 'total'}], ); To call a stored procedure with named arguments from a hashref. This is typically done when mapping object properties in to stored procedure arguments. my @results = $obj->call_dbmethod( funcname => $funcname, funcschema => $funcname, running_funcs => [{agg => 'sum(amount)', alias => 'total'}], ); To call a stored procedure with named arguments from a hashref with overrides. my @results = $obj->call_dbmethod( funcname => 'customer_save', funcschema => 'public', running_funcs => [{agg => 'sum(amount)', alias => 'total'}], args => { id => undef }, # force to create new! ); =head1 EXPORTS We now allow various calls to be exported. We recommend using the tags. =head2 One-at-a-time Exports =over =item call_dbmethod =item call_procedure =item set_dbh =item _set_funcprefix =item _set_funcschema =item _set_registry =back =head2 Export Tags Below are the export tags listed including the leading ':' used to invoke them. =over =item :mapper call_dbmethod, call_procedure, and set_dbh =item :full All methods that can be exported at once. =back =cut our @EXPORT_OK = qw(call_dbmethod call_procedure set_dbh associate dbh _set_funcprefix _set_funcschema _set_registry); our %EXPORT_TAGS = (mapper => [qw(call_dbmethod call_procedure set_dbh dbh)], full => \@EXPORT_OK); =head1 DESCRIPTION PGObject::Simple a top-half object system for PGObject which is simple and inspired by (and a subset functionally speaking of) the simple stored procedure object method system of LedgerSMB 1.3. The framework discovers stored procedure APIs and dispatches to them and can therefore be a base for application-specific object models and much more. PGObject::Simple is designed to be light-weight and yet robust glue between your object model and the RDBMS's stored procedures. It works by looking up the stored procedure arguments, stripping them of the conventional prefix 'in_', and mapping what is left to object property names. Properties can be overridden by passing in a hashrefs in the args named argument. Named arguments there will be used in place of object properties. This system is quite flexible, perhaps too much so, and it relies on the database encapsulating its own logic behind self-documenting stored procedures using consistent conventions. No function which is expected to be discovered can be overloaded, and all arguments must be named for their object properties. For this reason the use of this module fundamentally changes the contract of the stored procedure from that of a fixed number of arguments in fixed types contract to one where the name must be unique and the stored procedures must be coded to the application's interface. This inverts the way we typically think about stored procedures and makes them much more application friendly. =head1 SUBROUTINES/METHODS =head2 new This constructs a new object. Basically it copies the incoming hash (one level deep) and then blesses it. If the hash passed in has a dbh member, the dbh is set to that. This does not set the function prefix, as this is assumed to be done implicitly by subclasses. =cut sub new { my ($self) = shift @_; my %args = @_; my $ref = {}; $ref->{$_} = $args{$_} for keys %args; bless ($ref, $self); $ref->set_dbh($ref->{dbh}); $ref->_set_funcprefix($ref->{_funcprefix}); $ref->_set_funcschema($ref->{_funcschema}); $ref->_set_registry($ref->{_registry}); $ref->associate($self) if ref $self; return $ref; } =head2 set_dbh($dbh) Sets the database handle (needs DBD::Pg 2.0 or later) to $dbh =cut sub set_dbh { my ($self, $dbh) = @_; $self->{_dbh} = $dbh; } =head2 dbh Returns the database handle for the object. =cut sub dbh { my ($self) = @_; return ($self->{_dbh} or $self->{_DBH}); } =head2 associate($pgobject) Sets the db handle to that from the $pgobject. =cut sub associate { my ($self, $other) = @_; $self->set_dbh($other->dbh); } =head2 _set_funcprefix This sets the default funcprefix for future calls. The funcprefix can still be overridden by passing in an explicit '' in a call. This is used to "claim" a certain set of stored procedures in the database for use by an object. It is semi-private, intended to be called by subclasses directly, perhaps in constructors, but not from outside the object. =cut sub _set_funcprefix { my ($self, $funcprefix) = @_; $self->{_func_prefix} = $funcprefix; } =head2 _set_funcschema This sets the default funcschema for future calls. This is overwridden by per-call arguments, (PGObject::Util::DBMethod provides for such overrides on a per-method basis). =cut sub _set_funcschema { my ($self, $funcschema) = @_; $self->{_func_schema} = $funcschema; } =head2 _set_registry This sets the registry for future calls. The idea here is that this allows for application object model wrappers to set which registry they are using, both for predictability and ensuring that interoperability is possible. =cut sub _set_registry { my ($self, $registry) = @_; $self->{_registry} = $registry; } =head2 call_dbmethod Does a straight-forward mapping (as described below) to the stored procedure arguments. Stored procedure arguments are looked up, a leading 'in_' is stripped off where it exists, and the remaining string mapped back to an object property. The $args{args} hashref can be used to override arguments by name. Unknown properties are handled simply by passing a NULL in, so the stored procedures should be prepared to handle these. As with call_procedure below, this returns a single hashref when called in a scalar context, and a list of hashrefs when called in a list context. NEW IN 2.0: We now give preference to functions of the same name over properties. So $obj->foo() will be used before $obj->{foo}. This enables better data encapsulation. =cut sub _arg_defaults { my ($self, %args) = @_; local $@; if (ref $self) { $args{dbh} ||= eval { $self->dbh } ; $args{funcprefix} //= eval { $self->funcprefix } ; $args{funcschema} //= eval { $self->funcschema } ; $args{funcprefix} //= $self->{_func_prefix}; $args{funcschema} //= $self->{_func_schema}; $args{funcprefix} //= eval {$self->_get_prefix() }; } else { # see if we have package-level reader/factories $args{dbh} ||= "$self"->dbh; # if eval {"$self"->dbh}; $args{funcschema} //= "$self"->funcschema if eval {"$self"->funcschema}; $args{funcprefix} //= "$self"->funcprefix if eval {"$self"->funcprefix}; } $args{funcprefix} //= ''; return %args } sub _self_to_arg { # refactored from map call, purely internal my ($self, $args, $argname) = @_; my $db_arg; $argname =~ s/^in_//; local $@; if (ref $self and $argname){ if (eval { $self->can($argname) } ) { eval { $db_arg = $self->can($argname)->($self) }; } else { $db_arg = $self->{$argname}; } } $db_arg = $args->{args}->{$argname} if exists $args->{args}->{$argname}; $db_arg = $db_arg->to_db if eval {$db_arg->can('to_db')}; return $db_arg; } sub call_dbmethod { my ($self) = shift @_; my %args = @_; croak 'No function name provided' unless $args{funcname}; %args = _arg_defaults($self, %args); my $info = PGObject->function_info(%args); my $arglist = []; @{$arglist} = map { _self_to_arg($self, \%args, $_->{name}) } @{$info->{args}}; $args{args} = $arglist; # The conditional return is necessary since the object may carry a registry # --CT return $self->call_procedure(%args) if ref $self; return __PACKAGE__->call_procedure(%args); } =head2 call_procedure This is a lightweight wrapper around PGObject->call_procedure which merely passes the currently attached db connection in. We use the previously set funcprefix and dbh by default but other values can be passed in to override the default object's values. This returns a single hashref when called in a scalar context, and a list of hashrefs when called in a list context. When called in a scalar context it simply returns the single first row returned. =cut sub call_procedure { my ($self, %args) = @_; %args = _arg_defaults($self, %args); croak 'No DB handle provided' unless $args{dbh}; my @rows = PGObject->call_procedure(%args); return shift @rows unless wantarray; return @rows; } =head1 WRITING CLASSES WITH PGObject::Simple Unlike PGObject, which is only loosely tied to the functionality in question and presumes that relevant information will be passed over a functional interface, PGObject is a specific framework for object-oriented coding in Perl. It can therefore be used alone or with other modules to provide quite a bit of functionality. A PGObject::Simple object is a blessed hashref with no gettors or setters. This is thus ideal for cases where you are starting and just need some quick mappings of stored procedures to hashrefs. You reference properties simply with the $object->{property} syntax. There is very little encapsulation in objects, and very little abstraction except when it comes to the actual stored procedure interfaces. In essence, PGObject::Simple generally assumes that the actual data structure is essentially a public interface between the database and whatever else is going on with the application. The general methods can then wrap call_procedure and call_dbmethod calls, mapping out to stored procedures in the database. Stored procedures must be written to relatively exacting specifications. Arguments must be named, with names prefixed optionally with 'in_' (if the property name starts with 'in_' properly one must also prefix it). An example of a simple stored procedure might be: CREATE OR REPLACE FUNCTION customer_get(in_id int) returns customer RETURNS setof customer language sql as $$ select * from customer where id = $1; $$; This stored procedure could then be called with any of: $obj->call_dbmethod( funcname => 'customer_get', ); # retrieve the customer with the $obj->{id} id $obj->call_dbmethod( funcname => 'customer_get', args => {id => 3 }, ); # retrieve the customer with the id of 3 regardless of $obj->{id} $obj->call_procedure( funcname => 'customer_get', args => [3], ); =head1 AUTHOR Chris Travers, C<< >> =head1 BUGS Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT You can find documentation for this module with the perldoc command. perldoc PGObject::Simple You can also look for information at: =over 4 =item * RT: CPAN's request tracker (report bugs here) L =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Ratings L =item * Search CPAN L =back =head1 ACKNOWLEDGEMENTS =head1 LICENSE AND COPYRIGHT Copyright 2013-2017 Chris Travers. Redistribution and use in source and compiled forms with or without modification, are permitted provided that the following conditions are met: =over =item Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer as the first lines of this file unmodified. =item Redistributions in compiled form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the source code, documentation, and/or other materials provided with the distribution. =back THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =cut 1; # End of PGObject::Simple PGObject-Simple-3.000002/README0000644000175000017500000000356213105015211014477 0ustar chrischrisPGObject-Simple PBObject::Simple is a minimalist framework for mapping stored procedures in PostgreSQL to object methods. The framework is truly minimalist and hence the "Simple" designation (in fact the module contains less than 50 lines of code, and the code is dwarfed by both POD and test cases). It is intended to be of use for developers wishing for such a minimalist framework and those who may want to have a reference for how to build such a mapping framework themselves. The framework lends itself to a few specific antipatterns. Objects can become ill-formed, overly nebulous, or the like. It is thus very important when using this for actual development to ensure that acceptable data structures are well documented and that these are adhered to. This module is based on a simple idea, namely that stored procedures can tell application classes how to call them. See the POD for specific information and guidelines. INSTALLATION To install this module, run the following commands: perl Makefile.PL make make test make install SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc PGObject::Simple You can also look for information at: RT, CPAN's request tracker (report bugs here) http://rt.cpan.org/NoAuth/Bugs.html?Dist=PGObject-Simple AnnoCPAN, Annotated CPAN documentation http://annocpan.org/dist/PGObject-Simple CPAN Ratings http://cpanratings.perl.org/d/PGObject-Simple Search CPAN http://search.cpan.org/dist/PGObject-Simple/ LICENSE AND COPYRIGHT Copyright (C) 2013 Chris Travers This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. PGObject-Simple-3.000002/README.md0000644000175000017500000000356213105015211015076 0ustar chrischrisPGObject-Simple PBObject::Simple is a minimalist framework for mapping stored procedures in PostgreSQL to object methods. The framework is truly minimalist and hence the "Simple" designation (in fact the module contains less than 50 lines of code, and the code is dwarfed by both POD and test cases). It is intended to be of use for developers wishing for such a minimalist framework and those who may want to have a reference for how to build such a mapping framework themselves. The framework lends itself to a few specific antipatterns. Objects can become ill-formed, overly nebulous, or the like. It is thus very important when using this for actual development to ensure that acceptable data structures are well documented and that these are adhered to. This module is based on a simple idea, namely that stored procedures can tell application classes how to call them. See the POD for specific information and guidelines. INSTALLATION To install this module, run the following commands: perl Makefile.PL make make test make install SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc PGObject::Simple You can also look for information at: RT, CPAN's request tracker (report bugs here) http://rt.cpan.org/NoAuth/Bugs.html?Dist=PGObject-Simple AnnoCPAN, Annotated CPAN documentation http://annocpan.org/dist/PGObject-Simple CPAN Ratings http://cpanratings.perl.org/d/PGObject-Simple Search CPAN http://search.cpan.org/dist/PGObject-Simple/ LICENSE AND COPYRIGHT Copyright (C) 2013 Chris Travers This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. PGObject-Simple-3.000002/ignore.txt0000644000175000017500000000020313105015211015630 0ustar chrischrisblib* Makefile Makefile.old Build Build.bat _build* pm_to_blib* *.tar.gz .lwpcookies cover_db pod2htm*.tmp PGObject-Simple-* .git* PGObject-Simple-3.000002/MANIFEST0000644000175000017500000000064313117201516014755 0ustar chrischrisChanges ignore.txt lib/PGObject/Simple.pm LICENSE Makefile.PL MANIFEST This list of files MANIFEST.SKIP README README.md t/00-load.t t/01-constructor.t t/02-call_procedure.t t/boilerplate.t t/manifest.t t/pod-coverage.t t/pod.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) PGObject-Simple-3.000002/LICENSE0000644000175000017500000000241713105015211014622 0ustar chrischrisCopyright (c) 2013, Chris Travers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.PGObject-Simple-3.000002/MANIFEST.SKIP0000644000175000017500000000130113105502403015506 0ustar chrischris #!start included /usr/lib/perl5/5.10/ExtUtils/MANIFEST.SKIP # Avoid version control files. \B\.svn\b \B\.git\b \B\.gitignore\b \B\.hg\b # Avoid Makemaker generated and utility files. \bMANIFEST\.bak \bMakefile$ \bblib/ \bMakeMaker-\d \bpm_to_blib\.ts$ \bpm_to_blib$ \bblibdirs\.ts$ # 6.18 through 6.25 generated this # Avoid Module::Build generated and utility files. \bBuild$ \b_build/ # Avoid temp and backup files. ~$ \.old$ \#$ \b\.# \.bak$ # Avoid Devel::Cover files. \bcover_db\b #!end included /usr/lib/perl5/5.10/ExtUtils/MANIFEST.SKIP ^extlib ^Su-.+\.tar\.gz$ ^work ^tmp \bTAGS$ ^MYMETA.yml$ ^.travis.yml$ ^MYMETA.json$ \bSu-[\d\.\_]+ \bt_util/ Debian_CPANTS.txt \blib/Su/Procs/