Hello community, here is the log from the commit of package perl-Mojo-Pg for openSUSE:Factory checked in at 2017-06-09 15:58:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Mojo-Pg (Old) and /work/SRC/openSUSE:Factory/.perl-Mojo-Pg.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojo-Pg" Fri Jun 9 15:58:28 2017 rev:4 rq:502488 version:3.06 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Mojo-Pg/perl-Mojo-Pg.changes 2017-03-24 02:23:18.622007449 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Mojo-Pg.new/perl-Mojo-Pg.changes 2017-06-09 15:58:29.494487842 +0200 @@ -1,0 +2,11 @@ +Fri Jun 2 06:11:04 UTC 2017 - co...@suse.com + +- updated to 3.06 + see /usr/share/doc/packages/perl-Mojo-Pg/Changes + + 3.06 2017-06-01 + - Updated example application with tests. + - Improved Mojo::Pg to be a little less noisy by deactivating PrintWarn by + default. + +------------------------------------------------------------------- Old: ---- Mojo-Pg-3.05.tar.gz New: ---- Mojo-Pg-3.06.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Mojo-Pg.spec ++++++ --- /var/tmp/diff_new_pack.2bdzqA/_old 2017-06-09 15:58:30.086404298 +0200 +++ /var/tmp/diff_new_pack.2bdzqA/_new 2017-06-09 15:58:30.090403734 +0200 @@ -17,7 +17,7 @@ Name: perl-Mojo-Pg -Version: 3.05 +Version: 3.06 Release: 0 %define cpan_name Mojo-Pg Summary: Mojolicious ♥ PostgreSQL @@ -31,10 +31,10 @@ BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(DBD::Pg) >= 3.005001 -BuildRequires: perl(Mojolicious) >= 7.15 +BuildRequires: perl(Mojolicious) >= 7.32 BuildRequires: perl(SQL::Abstract) >= 1.81 Requires: perl(DBD::Pg) >= 3.005001 -Requires: perl(Mojolicious) >= 7.15 +Requires: perl(Mojolicious) >= 7.32 Requires: perl(SQL::Abstract) >= 1.81 %{perl_requires} ++++++ Mojo-Pg-3.05.tar.gz -> Mojo-Pg-3.06.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojo-Pg-3.05/Changes new/Mojo-Pg-3.06/Changes --- old/Mojo-Pg-3.05/Changes 2017-03-12 12:39:16.000000000 +0100 +++ new/Mojo-Pg-3.06/Changes 2017-06-01 17:40:12.000000000 +0200 @@ -1,4 +1,9 @@ +3.06 2017-06-01 + - Updated example application with tests. + - Improved Mojo::Pg to be a little less noisy by deactivating PrintWarn by + default. + 3.05 2017-03-12 - Improved from_string method in Mojo::Pg with search_path support. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojo-Pg-3.05/MANIFEST new/Mojo-Pg-3.06/MANIFEST --- old/Mojo-Pg-3.05/MANIFEST 2017-03-12 12:41:43.000000000 +0100 +++ new/Mojo-Pg-3.06/MANIFEST 2017-06-01 19:49:18.000000000 +0200 @@ -5,6 +5,7 @@ examples/blog/lib/Blog/Model/Posts.pm examples/blog/migrations/blog.sql examples/blog/script/blog +examples/blog/t/blog.t examples/blog/templates/layouts/blog.html.ep examples/blog/templates/posts/_form.html.ep examples/blog/templates/posts/create.html.ep diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojo-Pg-3.05/META.json new/Mojo-Pg-3.06/META.json --- old/Mojo-Pg-3.05/META.json 2017-03-12 12:41:43.000000000 +0100 +++ new/Mojo-Pg-3.06/META.json 2017-06-01 19:49:18.000000000 +0200 @@ -4,13 +4,13 @@ "Sebastian Riedel <s...@cpan.org>" ], "dynamic_config" : 0, - "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.28, CPAN::Meta::Converter version 2.150010", "license" : [ "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : "2" + "version" : 2 }, "name" : "Mojo-Pg", "no_index" : { @@ -35,7 +35,7 @@ "runtime" : { "requires" : { "DBD::Pg" : "3.005001", - "Mojolicious" : "7.15", + "Mojolicious" : "7.32", "SQL::Abstract" : "1.81", "perl" : "5.010001" } @@ -57,6 +57,6 @@ }, "x_IRC" : "irc://irc.perl.org/#mojo" }, - "version" : "3.05", - "x_serialization_backend" : "JSON::PP version 2.27400" + "version" : "3.06", + "x_serialization_backend" : "JSON::PP version 2.94" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojo-Pg-3.05/META.yml new/Mojo-Pg-3.06/META.yml --- old/Mojo-Pg-3.05/META.yml 2017-03-12 12:41:43.000000000 +0100 +++ new/Mojo-Pg-3.06/META.yml 2017-06-01 19:49:17.000000000 +0200 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 -generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.28, CPAN::Meta::Converter version 2.150010' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -21,7 +21,7 @@ - t requires: DBD::Pg: '3.005001' - Mojolicious: '7.15' + Mojolicious: '7.32' SQL::Abstract: '1.81' perl: '5.010001' resources: @@ -30,5 +30,5 @@ homepage: http://mojolicious.org license: http://www.opensource.org/licenses/artistic-license-2.0 repository: https://github.com/kraih/mojo-pg.git -version: '3.05' +version: '3.06' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojo-Pg-3.05/Makefile.PL new/Mojo-Pg-3.06/Makefile.PL --- old/Mojo-Pg-3.05/Makefile.PL 2017-02-11 13:31:58.000000000 +0100 +++ new/Mojo-Pg-3.06/Makefile.PL 2017-06-01 17:58:41.000000000 +0200 @@ -30,6 +30,6 @@ }, }, PREREQ_PM => - {'DBD::Pg' => 3.005001, Mojolicious => '7.15', 'SQL::Abstract' => '1.81'}, + {'DBD::Pg' => 3.005001, Mojolicious => '7.32', 'SQL::Abstract' => '1.81'}, test => {TESTS => 't/*.t t/*/*.t'} ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojo-Pg-3.05/README.md new/Mojo-Pg-3.06/README.md --- old/Mojo-Pg-3.05/README.md 2017-02-14 20:39:21.000000000 +0100 +++ new/Mojo-Pg-3.06/README.md 2017-04-23 16:27:20.000000000 +0200 @@ -54,4 +54,4 @@ ## Want to know more? Take a look at our excellent - [documentation](http://mojolicious.org/perldoc/Mojo/Pg>)! + [documentation](http://mojolicious.org/perldoc/Mojo/Pg)! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojo-Pg-3.05/examples/blog/t/blog.t new/Mojo-Pg-3.06/examples/blog/t/blog.t --- old/Mojo-Pg-3.05/examples/blog/t/blog.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Mojo-Pg-3.06/examples/blog/t/blog.t 2017-06-01 15:00:05.000000000 +0200 @@ -0,0 +1,64 @@ +use Mojo::Base -strict; + +use Test::More; + +# This test requires a PostgreSQL connection string for an existing database +# +# TEST_ONLINE=postgres://tester:testing@/test script/blog test +# +plan skip_all => 'set TEST_ONLINE to enable this test' unless $ENV{TEST_ONLINE}; + +use Mojo::Pg; +use Mojo::URL; +use Test::Mojo; + +# Isolate tests +my $url + = Mojo::URL->new($ENV{TEST_ONLINE})->query([search_path => 'mojo_blog_test']); +my $pg = Mojo::Pg->new($url); +$pg->db->query('drop schema if exists mojo_blog_test cascade'); +$pg->db->query('create schema mojo_blog_test'); + +# Override configuration for testing +my $t = Test::Mojo->new(Blog => {pg => $url, secrets => ['test_s3cret']}); +$t->ua->max_redirects(10); + +# No posts yet +$t->get_ok('/')->status_is(200)->text_is('title' => 'Blog') + ->text_is('body > a' => 'New post')->element_exists_not('h2'); + +# Create a new post +$t->get_ok('/posts/create')->status_is(200)->text_is('title' => 'New post') + ->element_exists('form input[name=title]') + ->element_exists('form textarea[name=body]'); +$t->post_ok('/posts' => form => {title => 'Testing', body => 'This is a test.'}) + ->status_is(200)->text_is('title' => 'Testing')->text_is('h2' => 'Testing') + ->text_like('p' => qr/This is a test/); + +# Read the post +$t->get_ok('/')->status_is(200)->text_is('title' => 'Blog') + ->text_is('h2 a' => 'Testing')->text_like('p' => qr/This is a test/); +$t->get_ok('/posts/1')->status_is(200)->text_is('title' => 'Testing') + ->text_is('h2' => 'Testing')->text_like('p' => qr/This is a test/) + ->text_is('body > a' => 'Edit'); + +# Update the post +$t->get_ok('/posts/1/edit')->status_is(200)->text_is('title' => 'Edit post') + ->element_exists('form input[name=title][value=Testing]') + ->text_like('form textarea[name=body]' => qr/This is a test/) + ->element_exists('form input[value=Remove]'); +$t->post_ok( + '/posts/1?_method=PUT' => form => {title => 'Again', body => 'It works.'}) + ->status_is(200)->text_is('title' => 'Again')->text_is('h2' => 'Again') + ->text_like('p' => qr/It works/); +$t->get_ok('/posts/1')->status_is(200)->text_is('title' => 'Again') + ->text_is('h2' => 'Again')->text_like('p' => qr/It works/); + +# Delete the post +$t->post_ok('/posts/1?_method=DELETE')->status_is(200) + ->text_is('title' => 'Blog')->element_exists_not('h2'); + +# Clean up once we are done +$pg->db->query('drop schema mojo_blog_test cascade'); + +done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojo-Pg-3.05/examples/blog/templates/posts/index.html.ep new/Mojo-Pg-3.06/examples/blog/templates/posts/index.html.ep --- old/Mojo-Pg-3.05/examples/blog/templates/posts/index.html.ep 2016-06-24 08:51:05.000000000 +0200 +++ new/Mojo-Pg-3.06/examples/blog/templates/posts/index.html.ep 2017-05-31 23:12:49.000000000 +0200 @@ -1,7 +1,7 @@ % layout 'blog', title => 'Blog'; % for my $post (@$posts) { + <h2><%= link_to $post->{title} => show_post => {id => $post->{id}} %></h2> <p> - <h2><%= link_to $post->{title} => show_post => {id => $post->{id}} %></h2> %= $post->{body} </p> % } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojo-Pg-3.05/lib/Mojo/Pg/Database.pm new/Mojo-Pg-3.06/lib/Mojo/Pg/Database.pm --- old/Mojo-Pg-3.05/lib/Mojo/Pg/Database.pm 2017-03-08 09:43:34.000000000 +0100 +++ new/Mojo-Pg-3.06/lib/Mojo/Pg/Database.pm 2017-05-08 17:26:14.000000000 +0200 @@ -263,7 +263,7 @@ =head2 delete - my $results = $db->delete($table, \%where); + my $results = $db->delete($table, \%where, \%options); Generate a C<DELETE> statement with L<Mojo::Pg/"abstract"> (usually an L<SQL::Abstract> object) and execute it with L</"query">. You can also append a @@ -287,6 +287,9 @@ # "delete from some_table where foo like '%test%'" $db->delete('some_table', {foo => {-like => '%test%'}}); + # "delete from some_table where foo = 'bar' returning id" + $db->delete('some_table', {foo => 'bar'}, {returning => 'id'}); + =head2 disconnect $db->disconnect; @@ -451,7 +454,7 @@ =head2 update - my $results = $db->update($table, \%fieldvals, \%where); + my $results = $db->update($table, \%fieldvals, \%where, \%options); Generate an C<UPDATE> statement with L<Mojo::Pg/"abstract"> (usually an L<SQL::Abstract> object) and execute it with L</"query">. You can also append a @@ -475,6 +478,9 @@ # "update some_table set foo = 'bar' where foo like '%test%'" $db->update('some_table', {foo => 'bar'}, {foo => {-like => '%test%'}}); + # "update some_table set foo = 'bar' where id = 23 returning id" + $db->update('some_table', {foo => 'bar'}, {id => 23}, {returning => 'id'}); + =head1 SEE ALSO L<Mojo::Pg>, L<Mojolicious::Guides>, L<http://mojolicious.org>. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojo-Pg-3.05/lib/Mojo/Pg.pm new/Mojo-Pg-3.06/lib/Mojo/Pg.pm --- old/Mojo-Pg-3.05/lib/Mojo/Pg.pm 2017-03-12 12:39:27.000000000 +0100 +++ new/Mojo-Pg-3.06/lib/Mojo/Pg.pm 2017-06-01 17:36:34.000000000 +0200 @@ -23,7 +23,13 @@ return $migrations; }; has options => sub { - {AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 0, RaiseError => 1}; + { + AutoCommit => 1, + AutoInactiveDestroy => 1, + PrintError => 0, + PrintWarn => 0, + RaiseError => 1 + }; }; has [qw(password username)] => ''; has pubsub => sub { @@ -32,7 +38,7 @@ return $pubsub; }; -our $VERSION = '3.05'; +our $VERSION = '3.06'; sub db { $_[0]->database_class->new(dbh => $_[0]->_dequeue, pg => $_[0]) } @@ -362,9 +368,9 @@ $pg = $pg->options({AutoCommit => 1, RaiseError => 1}); Options for database handles, defaults to activating C<AutoCommit>, -C<AutoInactiveDestroy> as well as C<RaiseError> and deactivating C<PrintError>. -Note that C<AutoCommit> and C<RaiseError> are considered mandatory, so -deactivating them would be very dangerous. +C<AutoInactiveDestroy> as well as C<RaiseError> and deactivating C<PrintError> +as well as C<PrintWarn>. Note that C<AutoCommit> and C<RaiseError> are +considered mandatory, so deactivating them would be very dangerous. =head2 password diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojo-Pg-3.05/t/connection.t new/Mojo-Pg-3.06/t/connection.t --- old/Mojo-Pg-3.05/t/connection.t 2017-03-12 12:37:05.000000000 +0100 +++ new/Mojo-Pg-3.06/t/connection.t 2017-06-01 17:42:42.000000000 +0200 @@ -8,8 +8,13 @@ is $pg->dsn, 'dbi:Pg:', 'right data source'; is $pg->username, '', 'no username'; is $pg->password, '', 'no password'; -my $options = {AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 0, - RaiseError => 1}; +my $options = { + AutoCommit => 1, + AutoInactiveDestroy => 1, + PrintError => 0, + PrintWarn => 0, + RaiseError => 1 +}; is_deeply $pg->options, $options, 'right options'; is $pg->search_path, undef, 'no search_path'; @@ -18,17 +23,27 @@ is $pg->dsn, 'dbi:Pg:dbname=test1', 'right data source'; is $pg->username, '', 'no username'; is $pg->password, '', 'no password'; -$options = {AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 0, - RaiseError => 1}; +$options = { + AutoCommit => 1, + AutoInactiveDestroy => 1, + PrintError => 0, + PrintWarn => 0, + RaiseError => 1 +}; is_deeply $pg->options, $options, 'right options'; # Minimal connection string with service and option -$pg = Mojo::Pg->new('postgres://?service=foo&PrintError=1'); +$pg = Mojo::Pg->new('postgres://?service=foo&PrintError=1&PrintWarn=1'); is $pg->dsn, 'dbi:Pg:service=foo', 'right data source'; is $pg->username, '', 'no username'; is $pg->password, '', 'no password'; -$options = {AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 1, - RaiseError => 1}; +$options = { + AutoCommit => 1, + AutoInactiveDestroy => 1, + PrintError => 1, + PrintWarn => 1, + RaiseError => 1 +}; is_deeply $pg->options, $options, 'right options'; # Connection string with service and search_path @@ -36,8 +51,13 @@ is $pg->dsn, 'dbi:Pg:service=foo', 'right data source'; is $pg->username, '', 'no username'; is $pg->password, '', 'no password'; -$options = {AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 0, - RaiseError => 1}; +$options = { + AutoCommit => 1, + AutoInactiveDestroy => 1, + PrintError => 0, + PrintWarn => 0, + RaiseError => 1 +}; is_deeply $pg->options, $options, 'right options'; is_deeply $pg->search_path, ['test_schema'], 'right search_path'; @@ -46,8 +66,13 @@ is $pg->dsn, 'dbi:Pg:dbname=c', 'right data source'; is $pg->username, 'a', 'no username'; is $pg->password, 'b', 'no password'; -$options = {AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 0, - RaiseError => 1}; +$options = { + AutoCommit => 1, + AutoInactiveDestroy => 1, + PrintError => 0, + PrintWarn => 0, + RaiseError => 1 +}; is_deeply $pg->options, $options, 'right options'; is_deeply $pg->search_path, ['test1', 'test2'], 'right search_path'; @@ -57,8 +82,13 @@ 'right data source'; is $pg->username, '', 'no username'; is $pg->password, '', 'no password'; -$options = {AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 0, - RaiseError => 1}; +$options = { + AutoCommit => 1, + AutoInactiveDestroy => 1, + PrintError => 0, + PrintWarn => 0, + RaiseError => 1 +}; is_deeply $pg->options, $options, 'right options'; # Connection string username but without host @@ -66,8 +96,13 @@ is $pg->dsn, 'dbi:Pg:dbname=test3', 'right data source'; is $pg->username, 'postgres', 'right username'; is $pg->password, '', 'no password'; -$options = {AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 0, - RaiseError => 1}; +$options = { + AutoCommit => 1, + AutoInactiveDestroy => 1, + PrintError => 0, + PrintWarn => 0, + RaiseError => 1 +}; is_deeply $pg->options, $options, 'right options'; # Connection string with unix domain socket and options @@ -76,8 +111,13 @@ is $pg->dsn, 'dbi:Pg:dbname=test4;host=/tmp/pg.sock', 'right data source'; is $pg->username, 'x1', 'right username'; is $pg->password, 'y2', 'right password'; -$options = {AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 1, - RaiseError => 0}; +$options = { + AutoCommit => 1, + AutoInactiveDestroy => 1, + PrintError => 1, + PrintWarn => 0, + RaiseError => 0 +}; is_deeply $pg->options, $options, 'right options'; # Connection string with lots of zeros @@ -85,8 +125,13 @@ is $pg->dsn, 'dbi:Pg:dbname=0', 'right data source'; is $pg->username, '0', 'right username'; is $pg->password, '0', 'right password'; -$options = {AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 0, - RaiseError => 0}; +$options = { + AutoCommit => 1, + AutoInactiveDestroy => 1, + PrintError => 0, + PrintWarn => 0, + RaiseError => 0 +}; is_deeply $pg->options, $options, 'right options'; # Invalid connection string