Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-Mojo-Pg for openSUSE:Factory 
checked in at 2026-05-24 19:35:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojo-Pg (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Mojo-Pg.new.2084 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Mojo-Pg"

Sun May 24 19:35:38 2026 rev:33 rq:1354959 version:5.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojo-Pg/perl-Mojo-Pg.changes        
2026-04-09 16:21:21.286154254 +0200
+++ /work/SRC/openSUSE:Factory/.perl-Mojo-Pg.new.2084/perl-Mojo-Pg.changes      
2026-05-24 19:38:07.245342986 +0200
@@ -1,0 +2,10 @@
+Wed May 13 10:47:26 UTC 2026 - Tina Müller <[email protected]>
+
+- updated to 5.0.0 (5.0)
+   see /usr/share/doc/packages/perl-Mojo-Pg/Changes
+
+  5.0  2026-05-11
+    - Added support for passing Mojo::SQL statements directly to query and 
query_p methods in Mojo::Pg::Database.
+    - Updated Perl requirement to 5.20.
+
+-------------------------------------------------------------------

Old:
----
  Mojo-Pg-4.29.tar.gz

New:
----
  Mojo-Pg-5.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Mojo-Pg.spec ++++++
--- /var/tmp/diff_new_pack.IBXLFc/_old  2026-05-24 19:38:09.801447777 +0200
+++ /var/tmp/diff_new_pack.IBXLFc/_new  2026-05-24 19:38:09.817448433 +0200
@@ -18,10 +18,10 @@
 
 %define cpan_name Mojo-Pg
 Name:           perl-Mojo-Pg
-Version:        4.290.0
+Version:        5.0.0
 Release:        0
-# 4.29 -> normalize -> 4.290.0
-%define cpan_version 4.29
+# 5.0 -> normalize -> 5.0.0
+%define cpan_version 5.0
 License:        Artistic-2.0
 Summary:        Wrapper around DBD::Pg for using PostgreSql with Mojolicious
 URL:            https://metacpan.org/release/%{cpan_name}
@@ -32,9 +32,11 @@
 BuildRequires:  perl
 BuildRequires:  perl-macros
 BuildRequires:  perl(DBD::Pg) >= 3.7.4
+BuildRequires:  perl(Mojo::SQL) >= 0.10
 BuildRequires:  perl(Mojolicious) >= 8.500
 BuildRequires:  perl(SQL::Abstract::Pg) >= 1.0
 Requires:       perl(DBD::Pg) >= 3.7.4
+Requires:       perl(Mojo::SQL) >= 0.10
 Requires:       perl(Mojolicious) >= 8.500
 Requires:       perl(SQL::Abstract::Pg) >= 1.0
 Provides:       perl(Mojo::Pg) = %{version}

++++++ Mojo-Pg-4.29.tar.gz -> Mojo-Pg-5.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.29/Changes new/Mojo-Pg-5.0/Changes
--- old/Mojo-Pg-4.29/Changes    2026-03-23 11:25:47.000000000 +0100
+++ new/Mojo-Pg-5.0/Changes     2026-05-11 17:52:29.000000000 +0200
@@ -1,4 +1,8 @@
 
+5.0  2026-05-11
+  - Added support for passing Mojo::SQL statements directly to query and 
query_p methods in Mojo::Pg::Database.
+  - Updated Perl requirement to 5.20.
+
 4.29  2026-03-23
   - Added rv attribute to Mojo::Pg::Results.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.29/META.json new/Mojo-Pg-5.0/META.json
--- old/Mojo-Pg-4.29/META.json  2026-03-23 11:29:32.000000000 +0100
+++ new/Mojo-Pg-5.0/META.json   2026-05-12 12:04:29.000000000 +0200
@@ -35,9 +35,10 @@
       "runtime" : {
          "requires" : {
             "DBD::Pg" : "3.007004",
+            "Mojo::SQL" : "0.01",
             "Mojolicious" : "8.50",
             "SQL::Abstract::Pg" : "1.0",
-            "perl" : "5.016"
+            "perl" : "5.020"
          }
       }
    },
@@ -60,6 +61,6 @@
          "web" : "https://web.libera.chat/#mojo";
       }
    },
-   "version" : "4.29",
+   "version" : "5.0",
    "x_serialization_backend" : "JSON::PP version 4.16"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.29/META.yml new/Mojo-Pg-5.0/META.yml
--- old/Mojo-Pg-4.29/META.yml   2026-03-23 11:29:32.000000000 +0100
+++ new/Mojo-Pg-5.0/META.yml    2026-05-12 12:04:29.000000000 +0200
@@ -21,9 +21,10 @@
     - t
 requires:
   DBD::Pg: '3.007004'
+  Mojo::SQL: '0.01'
   Mojolicious: '8.50'
   SQL::Abstract::Pg: '1.0'
-  perl: '5.016'
+  perl: '5.020'
 resources:
   IRC:
     url: irc://irc.libera.chat/#mojo
@@ -32,5 +33,5 @@
   homepage: https://mojolicious.org
   license: http://www.opensource.org/licenses/artistic-license-2.0
   repository: https://github.com/mojolicious/mojo-pg.git
-version: '4.29'
+version: '5.0'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.020'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.29/Makefile.PL new/Mojo-Pg-5.0/Makefile.PL
--- old/Mojo-Pg-4.29/Makefile.PL        2021-10-29 21:08:31.000000000 +0200
+++ new/Mojo-Pg-5.0/Makefile.PL 2026-05-11 17:52:29.000000000 +0200
@@ -1,4 +1,4 @@
-use 5.016;
+use 5.020;
 
 use strict;
 use warnings;
@@ -16,7 +16,7 @@
     dynamic_config => 0,
     'meta-spec'    => {version   => 2},
     no_index       => {directory => ['examples', 't']},
-    prereqs        => {runtime   => {requires => {perl => '5.016'}}},
+    prereqs        => {runtime   => {requires => {perl => '5.020'}}},
     resources      => {
       bugtracker => {web => 'https://github.com/mojolicious/mojo-pg/issues'},
       homepage   => 'https://mojolicious.org',
@@ -29,6 +29,6 @@
       x_IRC => {url => 'irc://irc.libera.chat/#mojo', web => 
'https://web.libera.chat/#mojo'}
     },
   },
-  PREREQ_PM => {'DBD::Pg' => 3.007004, Mojolicious => '8.50', 
'SQL::Abstract::Pg' => '1.0'},
+  PREREQ_PM => {'DBD::Pg' => 3.007004, Mojolicious => '8.50', 'Mojo::SQL' => 
'0.01', 'SQL::Abstract::Pg' => '1.0'},
   test      => {TESTS     => 't/*.t t/*/*.t'}
 );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.29/lib/Mojo/Pg/Database.pm 
new/Mojo-Pg-5.0/lib/Mojo/Pg/Database.pm
--- old/Mojo-Pg-4.29/lib/Mojo/Pg/Database.pm    2026-03-23 11:04:21.000000000 
+0100
+++ new/Mojo-Pg-5.0/lib/Mojo/Pg/Database.pm     2026-05-11 17:52:29.000000000 
+0200
@@ -8,7 +8,8 @@
 use Mojo::Pg::Results;
 use Mojo::Pg::Transaction;
 use Mojo::Promise;
-use Mojo::Util qw(monkey_patch);
+use Mojo::Util   qw(monkey_patch);
+use Scalar::Util qw(blessed);
 
 has 'dbh';
 has pg => undef, weak => 1;
@@ -75,8 +76,10 @@
 sub ping { shift->dbh->ping }
 
 sub query {
-  my ($self, $query) = (shift, shift);
-  my $cb = ref $_[-1] eq 'CODE' ? pop : undef;
+  my ($self, $query, @args) = @_;
+  my $cb = ref $args[-1] eq 'CODE' ? pop @args : undef;
+
+  ($query, @args) = $query->to_list if (blessed($query) && 
$query->isa('Mojo::SQL::Statement'));
 
   croak 'Non-blocking query already in progress' if $self->{waiting};
 
@@ -86,8 +89,8 @@
   my $sth = $self->dbh->prepare_cached($query, \%attrs, 3);
   local $sth->{HandleError} = sub { $_[0] = shortmess $_[0]; 0 };
 
-  for (my $i = 0; $#_ >= $i; $i++) {
-    my ($param, $attrs) = ($_[$i], {});
+  for (my $i = 0; $#args >= $i; $i++) {
+    my ($param, $attrs) = ($args[$i], {});
     if (ref $param eq 'HASH') {
       if    (exists $param->{-json}) { $param = to_json $param->{-json} }
       elsif (exists $param->{json})  { $param = to_json $param->{json} }
@@ -177,10 +180,10 @@
 
       return $self->_unwatch if !$self->_notifications && !$self->{waiting};
 
-      return if !$self->{waiting} || !$dbh->pg_ready;
+      # Do not raise exceptions inside the event loop
+      return if !$self->{waiting} || !do { local $dbh->{RaiseError} = 0; 
$dbh->pg_ready };
       my ($sth, $cb) = @{delete $self->{waiting}}{qw(sth cb)};
 
-      # Do not raise exceptions inside the event loop
       my $rv  = do { local $dbh->{RaiseError} = 0; $dbh->pg_result };
       my $err = defined $rv ? undef : $dbh->errstr;
 
@@ -425,6 +428,7 @@
   my $results = $db->query('SELECT * FROM foo');
   my $results = $db->query('INSERT INTO foo VALUES (?, ?, ?)', @values);
   my $results = $db->query('SELECT ?::JSON AS foo', {-json => {bar => 'baz'}});
+  my $results = $db->query(sql('SELECT * FROM foo WHERE id = ?', $id));
 
 Execute a blocking 
L<SQL|http://www.postgresql.org/docs/current/static/sql.html> statement and 
return a results object
 based on L</"results_class"> (which is usually L<Mojo::Pg::Results>) with the 
query results. The L<DBD::Pg> statement
@@ -436,6 +440,12 @@
   });
   Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
 
+For composable SQL statements with protection from SQL injection attacks, you 
can also pass a L<Mojo::SQL::Statement>
+object and all bind values will be used automatically.
+
+  use Mojo::SQL qw(sql);
+  $db->query(sql('SELECT ?::INT AS foo', 23));
+
 Hash reference arguments containing a value named C<-json> or C<json> will be 
encoded to JSON text with
 L<Mojo::JSON/"to_json">. To accomplish the reverse, you can use the method 
L<Mojo::Pg::Results/"expand">, which
 automatically decodes all fields of the types C<json> and C<jsonb> with 
L<Mojo::JSON/"from_json"> to Perl values.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.29/lib/Mojo/Pg.pm 
new/Mojo-Pg-5.0/lib/Mojo/Pg.pm
--- old/Mojo-Pg-4.29/lib/Mojo/Pg.pm     2026-03-23 11:25:38.000000000 +0100
+++ new/Mojo-Pg-5.0/lib/Mojo/Pg.pm      2026-05-11 17:52:29.000000000 +0200
@@ -22,7 +22,7 @@
 has [qw(password username)] => '';
 has pubsub                  => sub { Mojo::Pg::PubSub->new(pg => shift) };
 
-our $VERSION = '4.29';
+our $VERSION = '5.0';
 
 sub db { $_[0]->database_class->new(dbh => $_[0]->_prepare, pg => $_[0]) }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.29/t/database.t 
new/Mojo-Pg-5.0/t/database.t
--- old/Mojo-Pg-4.29/t/database.t       2022-07-04 18:24:55.000000000 +0200
+++ new/Mojo-Pg-5.0/t/database.t        2026-05-11 17:52:29.000000000 +0200
@@ -10,6 +10,7 @@
 use Mojo::JSON qw(true);
 use Mojo::Pg;
 use Mojo::Promise;
+use Mojo::SQL qw(sql);
 use Scalar::Util qw(refaddr);
 
 my $pg = Mojo::Pg->new($ENV{TEST_ONLINE});
@@ -29,6 +30,11 @@
     'right structure';
 };
 
+subtest 'Mojo::SQL statement' => sub {
+  my $sql = sql('SELECT ?::INT AS one, ?::INT AS two', 1, 2);
+  is_deeply $pg->db->query($sql)->hash, {one => 1, two => 2}, 'right 
structure';
+};
+
 subtest 'Non-blocking select' => sub {
   my ($fail, $result);
   my $same;
@@ -338,4 +344,25 @@
   is $fail, 'Premature connection close', 'right error';
 };
 
+subtest 'Non-blocking query with connection terminated mid-query' => sub {
+  my ($fail, $count);
+  my $db  = $pg->db;
+  my $pid = $db->query('SELECT pg_backend_pid() AS pid')->hash->{pid};
+  $count = 0;
+  $db->query(
+    'SELECT pg_sleep(10)' => sub {
+      my ($db, $err, $results) = @_;
+      $count++;
+      $fail = $err;
+      Mojo::IOLoop->stop;
+    }
+  );
+  Mojo::IOLoop->timer(0.1 => sub { $pg->db->query("SELECT 
pg_terminate_backend($pid)") });
+  my $timeout = Mojo::IOLoop->timer(5 => sub { Mojo::IOLoop->stop });
+  Mojo::IOLoop->start;
+  Mojo::IOLoop->remove($timeout);
+  is $count, 1, 'callback called exactly once';
+  ok $fail, 'error propagated';
+};
+
 done_testing();

++++++ _scmsync.obsinfo ++++++
--- /var/tmp/diff_new_pack.IBXLFc/_old  2026-05-24 19:38:10.941494515 +0200
+++ /var/tmp/diff_new_pack.IBXLFc/_new  2026-05-24 19:38:10.969495663 +0200
@@ -1,6 +1,6 @@
-mtime: 1774264275
-commit: 600dda4e547918265f0b9bb7b0e5947549a19015bf402bf38ce83a073dd4a831
-url: https://src.opensuse.org/perl/perl-Mojo-Pg.git
-revision: 600dda4e547918265f0b9bb7b0e5947549a19015bf402bf38ce83a073dd4a831
+mtime: 1778669246
+commit: e25ada31ef063e47e4148b5d92341a88bb54595e4de0364cee9da603afa141f5
+url: https://src.opensuse.org/perl/perl-Mojo-Pg
+revision: e25ada31ef063e47e4148b5d92341a88bb54595e4de0364cee9da603afa141f5
 projectscmsync: https://src.opensuse.org/perl/_ObsPrj
 

++++++ build.specials.obscpio ++++++

++++++ build.specials.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/.gitignore new/.gitignore
--- old/.gitignore      1970-01-01 01:00:00.000000000 +0100
+++ new/.gitignore      2026-05-13 12:47:26.000000000 +0200
@@ -0,0 +1 @@
+.osc

Reply via email to