Hello community,

here is the log from the commit of package perl-Mojo-Pg for openSUSE:Factory 
checked in at 2020-10-27 19:01:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojo-Pg (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Mojo-Pg.new.3463 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Mojo-Pg"

Tue Oct 27 19:01:38 2020 rev:24 rq:844259 version:4.21

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojo-Pg/perl-Mojo-Pg.changes        
2020-10-05 19:43:11.905790652 +0200
+++ /work/SRC/openSUSE:Factory/.perl-Mojo-Pg.new.3463/perl-Mojo-Pg.changes      
2020-10-27 19:01:52.710871305 +0100
@@ -1,0 +2,10 @@
+Mon Oct 26 03:08:41 UTC 2020 - Tina Müller <timueller+p...@suse.de>
+
+- updated to 4.21
+   see /usr/share/doc/packages/perl-Mojo-Pg/Changes
+
+  4.21  2020-10-25
+    - Added reset method to Mojo::Pg.
+    - Changed SQL style to use uppercase keywords.
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ perl-Mojo-Pg.spec ++++++
--- /var/tmp/diff_new_pack.vxbhR6/_old  2020-10-27 19:01:53.250871698 +0100
+++ /var/tmp/diff_new_pack.vxbhR6/_new  2020-10-27 19:01:53.254871701 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Mojo-Pg
-Version:        4.20
+Version:        4.21
 Release:        0
 %define cpan_name Mojo-Pg
 Summary:        Wrapper around DBD::Pg for using PostgreSql with Mojolicious

++++++ Mojo-Pg-4.20.tar.gz -> Mojo-Pg-4.21.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/Changes new/Mojo-Pg-4.21/Changes
--- old/Mojo-Pg-4.20/Changes    2020-10-01 15:43:29.000000000 +0200
+++ new/Mojo-Pg-4.21/Changes    2020-10-25 18:08:42.000000000 +0100
@@ -1,4 +1,8 @@
 
+4.21  2020-10-25
+  - Added reset method to Mojo::Pg.
+  - Changed SQL style to use uppercase keywords.
+
 4.20  2020-10-01
   - Fixed fork-safety feature to work with more than one fork.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/META.json new/Mojo-Pg-4.21/META.json
--- old/Mojo-Pg-4.20/META.json  2020-10-02 13:02:59.000000000 +0200
+++ new/Mojo-Pg-4.21/META.json  2020-10-26 00:09:25.000000000 +0100
@@ -4,7 +4,7 @@
       "Sebastian Riedel <s...@cpan.org>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "ExtUtils::MakeMaker version 7.46, CPAN::Meta::Converter 
version 2.150010",
+   "generated_by" : "ExtUtils::MakeMaker version 7.50, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
       "artistic_2"
    ],
@@ -60,6 +60,6 @@
          "web" : "https://webchat.freenode.net/#mojo";
       }
    },
-   "version" : "4.20",
+   "version" : "4.21",
    "x_serialization_backend" : "JSON::PP version 4.05"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/META.yml new/Mojo-Pg-4.21/META.yml
--- old/Mojo-Pg-4.20/META.yml   2020-10-02 13:02:59.000000000 +0200
+++ new/Mojo-Pg-4.21/META.yml   2020-10-26 00:09:25.000000000 +0100
@@ -7,7 +7,7 @@
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 7.46, CPAN::Meta::Converter version 
2.150010'
+generated_by: 'ExtUtils::MakeMaker version 7.50, CPAN::Meta::Converter version 
2.150010'
 license: artistic_2
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -32,5 +32,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.20'
+version: '4.21'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/README.md new/Mojo-Pg-4.21/README.md
--- old/Mojo-Pg-4.20/README.md  2020-05-30 23:50:14.000000000 +0200
+++ new/Mojo-Pg-4.21/README.md  2020-10-24 19:46:08.000000000 +0200
@@ -19,10 +19,10 @@
   my $ip = $c->tx->remote_address;
 
   # Store information about current visitor blocking
-  $db->query('insert into visitors values (now(), ?)', $ip);
+  $db->query('INSERT INTO visitors VALUES (NOW(), ?)', $ip);
 
   # Retrieve information about previous visitors non-blocking
-  $db->query('select * from visitors limit 50' => sub ($db, $err, $results) {
+  $db->query('SELECT * FROM visitors LIMIT 50' => sub ($db, $err, $results) {
 
     return $c->reply->exception($err) if $err;
 
@@ -35,9 +35,9 @@
 
 @@ migrations
 -- 1 up
-create table visitors (at timestamp with time zone, ip text);
+CREATE TABLE visitors (at TIMESTAMP WITH TIME ZONE, ip TEXT);
 -- 1 down
-drop table visitors;
+DROP TABLE visitors;
 ```
 
 ## Installation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/examples/blog/t/blog.t 
new/Mojo-Pg-4.21/examples/blog/t/blog.t
--- old/Mojo-Pg-4.20/examples/blog/t/blog.t     2020-05-31 00:19:25.000000000 
+0200
+++ new/Mojo-Pg-4.21/examples/blog/t/blog.t     2020-10-24 23:30:42.000000000 
+0200
@@ -15,8 +15,8 @@
 # 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');
+$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']});
@@ -51,6 +51,6 @@
 $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');
+$pg->db->query('DROP SCHEMA mojo_blog_test CASCADE');
 
 done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/lib/Mojo/Pg/Database.pm 
new/Mojo-Pg-4.21/lib/Mojo/Pg/Database.pm
--- old/Mojo-Pg-4.20/lib/Mojo/Pg/Database.pm    2020-10-01 15:43:49.000000000 
+0200
+++ new/Mojo-Pg-4.21/lib/Mojo/Pg/Database.pm    2020-10-24 23:47:39.000000000 
+0200
@@ -51,7 +51,7 @@
   my ($self, $name) = @_;
 
   my $dbh = $self->dbh;
-  $dbh->do('listen ' . $dbh->quote_identifier($name)) unless 
$self->{listen}{$name}++;
+  $dbh->do('LISTEN ' . $dbh->quote_identifier($name)) unless 
$self->{listen}{$name}++;
   $self->_watch;
 
   return $self;
@@ -61,7 +61,7 @@
   my ($self, $name, $payload) = @_;
 
   my $dbh    = $self->dbh;
-  my $notify = 'notify ' . $dbh->quote_identifier($name);
+  my $notify = 'NOTIFY ' . $dbh->quote_identifier($name);
   $notify .= ', ' . $dbh->quote($payload) if defined $payload;
   $dbh->do($notify);
   $self->_notifications;
@@ -125,7 +125,7 @@
   my ($self, $name) = @_;
 
   my $dbh = $self->dbh;
-  $dbh->do('unlisten ' . $dbh->quote_identifier($name));
+  $dbh->do('UNLISTEN ' . $dbh->quote_identifier($name));
   $name eq '*' ? delete $self->{listen} : delete $self->{listen}{$name};
   $self->_unwatch unless $self->{waiting} || $self->is_listening;
 
@@ -194,8 +194,7 @@
   use Mojo::Pg::Database;
 
   my $db = Mojo::Pg::Database->new(pg => $pg, dbh => $dbh);
-  $db->query('select * from foo')
-    ->hashes->map(sub { $_->{bar} })->join("\n")->say;
+  $db->query('SELECT * FROM foo') ->hashes->map(sub { $_->{bar} 
})->join("\n")->say;
 
 =head1 DESCRIPTION
 
@@ -287,16 +286,16 @@
 
 Use all the same argument variations you would pass to the C<delete> method of 
L<SQL::Abstract>.
 
-  # "delete from some_table"
+  # "DELETE FROM some_table"
   $db->delete('some_table');
 
-  # "delete from some_table where foo = 'bar'"
+  # "DELETE FROM some_table WHERE foo = 'bar'"
   $db->delete('some_table', {foo => 'bar'});
 
-  # "delete from some_table where foo like '%test%'"
+  # "DELETE from some_table WHERE foo LIKE '%test%'"
   $db->delete('some_table', {foo => {-like => '%test%'}});
 
-  # "delete from some_table where foo = 'bar' returning id"
+  # "DELETE FROM some_table WHERE foo = 'bar' RETURNING id"
   $db->delete('some_table', {foo => 'bar'}, {returning => 'id'});
 
 =head2 delete_p
@@ -327,7 +326,7 @@
 Activate C<pg_placeholder_dollaronly> for next L</"query"> call and allow C<?> 
to be used as an operator.
 
   # Check for a key in a JSON document
-  $db->dollar_only->query('select * from foo where bar ? $1', 'baz')
+  $db->dollar_only->query('SELECT * FROM foo WHERE bar ? $1', 'baz')
     ->expand->hashes->map(sub { $_->{bar}{baz} })->join("\n")->say;
 
 =head2 insert
@@ -345,35 +344,33 @@
 
 Use all the same argument variations you would pass to the C<insert> method of 
L<SQL::Abstract>.
 
-  # "insert into some_table (foo, baz) values ('bar', 'yada')"
+  # "INSERT INTO some_table (foo, baz) VALUES ('bar', 'yada')"
   $db->insert('some_table', {foo => 'bar', baz => 'yada'});
 
-  # "insert into some_table (foo) values ({1,2,3})"
+  # "INSERT INTO some_table (foo) VALUES ({1,2,3})"
   $db->insert('some_table', {foo => [1, 2, 3]});
 
-  # "insert into some_table (foo) values ('bar') returning id"
+  # "INSERT INTO some_table (foo) VALUES ('bar') RETURNING id"
   $db->insert('some_table', {foo => 'bar'}, {returning => 'id'});
 
-  # "insert into some_table (foo) values ('bar') returning id, foo"
+  # "INSERT INTO some_table (foo) VALUES ('bar') RETURNING id, foo"
   $db->insert('some_table', {foo => 'bar'}, {returning => ['id', 'foo']});
 
 As well as some PostgreSQL specific extensions added by L<SQL::Abstract::Pg>.
 
-  # "insert into some_table (foo) values ('{"test":23}')"
+  # "INSERT INTO some_table (foo) VALUES ('{"test":23}')"
   $db->insert('some_table', {foo => {-json => {test => 23}}});
 
-  # "insert into some_table (foo) values ('bar') on conflict do nothing"
+  # "INSERT INTO some_table (foo) VALUES ('bar') ON CONFLICT DO NOTHING"
   $db->insert('some_table', {foo => 'bar'}, {on_conflict => undef});
 
 Including operations commonly referred to as C<upsert>.
 
-  # "insert into t (a) values ('b') on conflict (a) do update set a = 'c'"
+  # "INSERT INTO t (a) VALUES ('b') ON CONFLICT (a) DO UPDATE SET a = 'c'"
   $db->insert('t', {a => 'b'}, {on_conflict => [a => {a => 'c'}]});
 
-  # "insert into t (a, b) values ('c', 'd')
-  #  on conflict (a, b) do update set a = 'e'"
-  $db->insert(
-    't', {a => 'c', b => 'd'}, {on_conflict => [['a', 'b'] => {a => 'e'}]});
+  # "INSERT INTO t (a, b) VALUES ('c', 'd') ON CONFLICT (a, b) DO UPDATE SET a 
= 'e'"
+  $db->insert('t', {a => 'c', b => 'd'}, {on_conflict => [['a', 'b'] => {a => 
'e'}]});
 
 =head2 insert_p
 
@@ -423,16 +420,16 @@
 
 =head2 query
 
-  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('SELECT * FROM foo');
+  my $results = $db->query('INSERT INTO foo VALUES (?, ?, ?)', @values);
+  my $results = $db->query('SELECT ?::JSON AS foo', {-json => {bar => 'baz'}});
 
 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
 handle will be automatically reused when it is not active anymore, to increase 
the performance of future queries. You
 can also append a callback to perform operations non-blocking.
 
-  $db->query('insert into foo values (?, ?, ?)' => @values => sub {
+  $db->query('INSERT INTO foo VALUES (?, ?, ?)' => @values => sub {
     my ($db, $err, $results) = @_;
     ...
   });
@@ -443,24 +440,23 @@
 automatically decodes all fields of the types C<json> and C<jsonb> with 
L<Mojo::JSON/"from_json"> to Perl values.
 
   # "I ♥ Mojolicious!"
-  $db->query('select ?::jsonb as foo', {-json => {bar => 'I ♥ Mojolicious!'}})
-    ->expand->hash->{foo}{bar};
+  $db->query('SELECT ?::JSONB AS foo', {-json => {bar => 'I ♥ Mojolicious!'}}) 
->expand->hash->{foo}{bar};
 
 Hash reference arguments containing values named C<type> and C<value> can be 
used to bind specific L<DBD::Pg> data
 types to placeholders.
 
   # Insert binary data
   use DBD::Pg ':pg_types';
-  $db->query('insert into bar values (?)', {type => PG_BYTEA, value => 
$bytes});
+  $db->query('INSERT INTO bar VALUES (?)', {type => PG_BYTEA, value => 
$bytes});
 
 =head2 query_p
 
-  my $promise = $db->query_p('select * from foo');
+  my $promise = $db->query_p('SELECT * FROM foo');
 
 Same as L</"query">, but performs all operations non-blocking and returns a 
L<Mojo::Promise> object instead of
 accepting a callback.
 
-  $db->query_p('insert into foo values (?, ?, ?)' => @values)->then(sub {
+  $db->query_p('INSERT INTO foo VALUES (?, ?, ?)' => @values)->then(sub {
     my $results = shift;
     ...
   })->catch(sub {
@@ -483,56 +479,56 @@
 
 Use all the same argument variations you would pass to the C<select> method of 
L<SQL::Abstract>.
 
-  # "select * from some_table"
+  # "SELECT * FROM some_table"
   $db->select('some_table');
 
-  # "select id, foo from some_table"
+  # "SELECT id, foo FROM some_table"
   $db->select('some_table', ['id', 'foo']);
 
-  # "select * from some_table where foo = 'bar'"
+  # "SELECT * FROM some_table WHERE foo = 'bar'"
   $db->select('some_table', undef, {foo => 'bar'});
 
-  # "select * from some_table where foo like '%test%'"
+  # "SELECT * FROM some_table WHERE foo LIKE '%test%'"
   $db->select('some_table', undef, {foo => {-like => '%test%'}});
 
 As well as some PostgreSQL specific extensions added by L<SQL::Abstract::Pg>.
 
-  # "select * from foo join bar on (bar.foo_id = foo.id)"
+  # "SELECT * FROM foo JOIN bar ON (bar.foo_id = foo.id)"
   $db->select(['foo', ['bar', foo_id => 'id']]);
 
-  # "select * from foo left join bar on (bar.foo_id = foo.id)"
+  # "SELECT * FROM foo LEFT JOIN bar ON (bar.foo_id = foo.id)"
   $db->select(['foo', [-left => 'bar', foo_id => 'id']]);
 
-  # "select foo as bar from some_table"
+  # "SELECT foo AS bar FROM some_table"
   $db->select('some_table', [[foo => 'bar']]);
 
-  # "select * from some_table where foo = '[1,2,3]'"
+  # "SELECT * FROM some_table WHERE foo = '[1,2,3]'"
   $db->select('some_table', '*', {foo => {'=' => {-json => [1, 2, 3]}}});
 
-  # "select extract(epoch from foo) as foo, bar from some_table"
-  $db->select('some_table', [\'extract(epoch from foo) as foo', 'bar']);
+  # "SELECT EXTRACT(EPOCH FROM foo) AS foo, bar FROM some_table"
+  $db->select('some_table', [\'extract(epoch from foo) AS foo', 'bar']);
 
-  # "select 'test' as foo, bar from some_table"
-  $db->select('some_table', [\['? as foo', 'test'], 'bar']);
+  # "SELECT 'test' AS foo, bar FROM some_table"
+  $db->select('some_table', [\['? AS foo', 'test'], 'bar']);
 
 Including a new last argument to pass many new options.
 
-  # "select * from some_table where foo = 'bar' order by id desc"
+  # "SELECT * FROM some_table WHERE foo = 'bar' ORDER BY id DESC"
   $db->select('some_table', '*', {foo => 'bar'}, {order_by => {-desc => 
'id'}});
 
-  # "select * from some_table limit 10 offset 20"
+  # "SELECT * FROM some_table LIMIT 10 OFFSET 20"
   $db->select('some_table', '*', undef, {limit => 10, offset => 20});
 
-  # "select * from some_table where foo = 23 group by foo, bar"
+  # "SELECT * FROM some_table WHERE foo = 23 GROUP BY foo, bar"
   $db->select('some_table', '*', {foo => 23}, {group_by => ['foo', 'bar']});
 
-  # "select * from t where a = 'b' group by c having d = 'e'"
+  # "SELECT * FROM t WHERE a = 'b' GROUP BY c HAVING d = 'e'"
   $db->select('t', '*', {a => 'b'}, {group_by => ['c'], having => {d => 'e'}});
 
-  # "select * from some_table where id = 1 for update"
+  # "SELECT * FROM some_table WHERE id = 1 FOR UPDATE"
   $db->select('some_table', '*', {id => 1}, {for => 'update'});
 
-  # "select * from some_table where id = 1 for update skip locked"
+  # "SELECT * FROM some_table WHERE id = 1 FOR UPDATE SKIP LOCKED"
   $db->select('some_table', '*', {id => 1}, {for => \'update skip locked'});
 
 =head2 select_p
@@ -582,19 +578,19 @@
 
 Use all the same argument variations you would pass to the C<update> method of 
L<SQL::Abstract>.
 
-  # "update some_table set foo = 'bar' where id = 23"
+  # "UPDATE some_table SET foo = 'bar' WHERE id = 23"
   $db->update('some_table', {foo => 'bar'}, {id => 23});
 
-  # "update some_table set foo = {1,2,3} where id = 23"
+  # "UPDATE some_table SET foo = {1,2,3} WHERE id = 23"
   $db->update('some_table', {foo => [1, 2, 3]}, {id => 23});
 
-  # "update some_table set foo = 'bar' where foo like '%test%'"
+  # "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"
+  # "UPDATE some_table SET foo = 'bar' WHERE id = 23 RETURNING id"
   $db->update('some_table', {foo => 'bar'}, {id => 23}, {returning => 'id'});
 
-  # "update some_table set foo = '[1,2,3]' where bar = 23"
+  # "UPDATE some_table SET foo = '[1,2,3]' WHERE bar = 23"
   $db->update('some_table', {foo => {-json => [1, 2, 3]}}, {bar => 23});
 
 =head2 update_p
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/lib/Mojo/Pg/Migrations.pm 
new/Mojo-Pg-4.21/lib/Mojo/Pg/Migrations.pm
--- old/Mojo-Pg-4.20/lib/Mojo/Pg/Migrations.pm  2020-10-01 15:43:50.000000000 
+0200
+++ new/Mojo-Pg-4.21/lib/Mojo/Pg/Migrations.pm  2020-10-24 23:31:09.000000000 
+0200
@@ -52,7 +52,7 @@
 
   # Lock migrations table and check version again
   my $tx = $db->begin;
-  $db->query('lock table mojo_migrations in exclusive mode');
+  $db->query('LOCK TABLE mojo_migrations IN EXCLUSIVE MODE');
   return $self if (my $active = $self->_active($db, 1)) == $target;
 
   # Newer version
@@ -60,7 +60,7 @@
 
   my $sql = $self->sql_for($active, $target);
   warn "-- Migrate ($active -> $target)\n$sql\n" if DEBUG;
-  $sql .= ';update mojo_migrations set version = $1 where name = $2;';
+  $sql .= ';UPDATE mojo_migrations SET version = $1 WHERE name = $2;';
   $db->query($sql, $target, $self->name) and $tx->commit;
 
   return $self;
@@ -88,18 +88,18 @@
   my $results;
   {
     local $db->dbh->{RaiseError} = 0;
-    my $sql = 'select version from mojo_migrations where name = $1';
+    my $sql = 'SELECT version FROM mojo_migrations WHERE name = $1';
     $results = $db->query($sql, $name);
   };
   if ((my $next = $results->array) || !$create) { return $next->[0] || 0 }
 
   $db->query(
-    'create table if not exists mojo_migrations (
-       name    text primary key,
-       version bigint not null check (version >= 0)
+    'CREATE TABLE IF NOT EXISTS mojo_migrations (
+       name    TEXT PRIMARY KEY,
+       version BIGINT NOT NULL CHECK (version >= 0)
      )'
   ) if $results->sth->err;
-  $db->query('insert into mojo_migrations values ($1, $2)', $name, 0);
+  $db->query('INSERT INTO mojo_migrations VALUES ($1, $2)', $name, 0);
 
   return 0;
 }
@@ -126,15 +126,15 @@
 UP/DOWN>.
 
   -- 1 up
-  create table messages (message text);
-  insert into messages values ('I ♥ Mojolicious!');
+  CREATE TABLE messages (message TEXT);
+  INSERT INTO messages VALUES ('I ♥ Mojolicious!');
   -- 1 down
-  drop table messages;
+  DROP TABLE messages;
 
   -- 2 up (...you can comment freely here...)
-  create table stuff (whatever int);
+  CREATE TABLE stuff (whatever INT);
   -- 2 down
-  drop table stuff;
+  DROP TABLE stuff;
 
 The idea is to let you migrate from any version, to any version, up and down. 
Migrations are very safe, because they
 are performed in transactions and only one can be performed at a time. If a 
single statement fails, the whole migration
@@ -181,10 +181,10 @@
   __DATA__
   @@ migrations
   -- 1 up
-  create table messages (message text);
-  insert into messages values ('I ♥ Mojolicious!');
+  CREATE TABLE messages (message TEXT);
+  INSERT INTO messages VALUES ('I ♥ Mojolicious!');
   -- 1 down
-  drop table messages;
+  DROP TABLE messages;
 
 =head2 from_file
 
@@ -196,9 +196,9 @@
 
   $migrations = $migrations->from_string(
     '-- 1 up
-     create table foo (bar int);
+     CREATE TABLE foo (bar INT);
      -- 1 down
-     drop table foo;'
+     DROP TABLE foo;'
   );
 
 Extract migrations from string.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/lib/Mojo/Pg.pm 
new/Mojo-Pg-4.21/lib/Mojo/Pg.pm
--- old/Mojo-Pg-4.20/lib/Mojo/Pg.pm     2020-10-01 15:43:49.000000000 +0200
+++ new/Mojo-Pg-4.21/lib/Mojo/Pg.pm     2020-10-25 18:07:28.000000000 +0100
@@ -22,7 +22,7 @@
 has [qw(password username)] => '';
 has pubsub                  => sub { Mojo::Pg::PubSub->new(pg => shift) };
 
-our $VERSION = '4.20';
+our $VERSION = '4.21';
 
 sub db { $_[0]->database_class->new(dbh => $_[0]->_prepare, pg => $_[0]) }
 
@@ -60,6 +60,8 @@
 
 sub new { @_ > 1 ? shift->SUPER::new->from_string(@_) : shift->SUPER::new }
 
+sub reset { ($_[0]->{queue} = []) and return $_[0] }
+
 sub _dequeue {
   my $self = shift;
 
@@ -73,7 +75,7 @@
   # Search path
   if (my $path = $self->search_path) {
     my $search_path = join ', ', map { $dbh->quote_identifier($_) } @$path;
-    $dbh->do("set search_path to $search_path");
+    $dbh->do("SET search_path TO $search_path");
   }
 
   $self->emit(connection => $dbh);
@@ -117,14 +119,14 @@
   my $pg = Mojo::Pg->new('postgresql://postgres@/test');
 
   # Select the server version
-  say $pg->db->query('select version() as version')->hash->{version};
+  say $pg->db->query('SELECT VERSION() AS version')->hash->{version};
 
   # Use migrations to create a table
   $pg->migrations->name('my_names_app')->from_string(<<EOF)->migrate;
   -- 1 up
-  create table names (id serial primary key, name text);
+  CREATE TABLE names (id SERIAL PRIMARY KEY, name TEXT);
   -- 1 down
-  drop table names;
+  DROP TABLE names;
   EOF
 
   # Use migrations to drop and recreate the table
@@ -142,8 +144,8 @@
   # Insert a few rows in a transaction with SQL and placeholders
   eval {
     my $tx = $db->begin;
-    $db->query('insert into names (name) values (?)', 'Sara');
-    $db->query('insert into names (name) values (?)', 'Stefan');
+    $db->query('INSERT INTO names (name) VALUES (?)', 'Sara');
+    $db->query('INSERT INTO names (name) VALUES (?)', 'Stefan');
     $tx->commit;
   };
   say $@ if $@;
@@ -152,7 +154,7 @@
   say $db->insert('names', {name => 'Daniel'}, {returning => 
'id'})->hash->{id};
 
   # JSON roundtrip
-  say $db->query('select ?::json as foo', {json => {bar => 'baz'}})
+  say $db->query('SELECT ?::JSON AS foo', {json => {bar => 'baz'}})
     ->expand->hash->{foo}{bar};
 
   # Select all rows blocking with SQL::Abstract
@@ -167,8 +169,8 @@
   Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
 
   # Concurrent non-blocking queries (synchronized with promises)
-  my $now   = $pg->db->query_p('select now() as now');
-  my $names = $pg->db->query_p('select * from names');
+  my $now   = $pg->db->query_p('SELECT NOW() AS now');
+  my $names = $pg->db->query_p('SELECT * FROM names');
   Mojo::Promise->all($now, $names)->then(sub {
     my ($now, $names) = @_;
     say $now->[0]->hash->{now};
@@ -212,7 +214,7 @@
   get '/' => sub {
     my $c  = shift;
     my $db = $c->pg->db;
-    $c->render(json => $db->query('select now() as now')->hash);
+    $c->render(json => $db->query('SELECT NOW() AS now')->hash);
   };
 
   app->start;
@@ -231,8 +233,8 @@
 multiple queries concurrently, you have to use multiple connections.
 
   # Performed concurrently (5 seconds)
-  $pg->db->query('select pg_sleep(5)' => sub {...});
-  $pg->db->query('select pg_sleep(5)' => sub {...});
+  $pg->db->query('SELECT PG_SLEEP(5)' => sub {...});
+  $pg->db->query('SELECT PG_SLEEP(5)' => sub {...});
 
 All cached database handles will be reset automatically if a new process has 
been forked, this allows multiple
 processes to share the same L<Mojo::Pg> object safely.
@@ -246,7 +248,7 @@
 
   has 'pg';
 
-  sub now { shift->pg->db->query('select now() as now')->hash }
+  sub now { shift->pg->db->query('SELECT NOW() AS now')->hash }
 
   1;
 
@@ -290,7 +292,7 @@
 
   $pg->on(connection => sub {
     my ($pg, $dbh) = @_;
-    $dbh->do('set search_path to my_schema');
+    $dbh->do('SET search_path TO my_schema');
   });
 
 =head1 ATTRIBUTES
@@ -398,10 +400,10 @@
 
   # Isolate tests and avoid race conditions when running them in parallel
   my $pg = Mojo::Pg->new('postgresql:///test')->search_path(['test_one']);
-  $pg->db->query('drop schema if exists test_one cascade');
-  $pg->db->query('create schema test_one');
+  $pg->db->query('DROP SCHEMA IF EXISTS test_one CASCADE');
+  $pg->db->query('CREATE SCHEMA test_one');
   ...
-  $pg->db->query('drop schema test_one cascade');
+  $pg->db->query('DROP SCHEMA test_one CASCADE');
 
 =head2 username
 
@@ -424,8 +426,7 @@
 time.
 
   # Add up all the money
-  say $pg->db->select('accounts')
-    ->hashes->reduce(sub { $a->{money} + $b->{money} });
+  say $pg->db->select('accounts')->hashes->reduce(sub { $a->{money} + 
$b->{money} });
 
 =head2 from_string
 
@@ -469,6 +470,12 @@
   # Customize configuration further
   my $pg = Mojo::Pg->new->dsn('dbi:Pg:service=foo');
 
+=head2 reset
+
+  $pg = $pg->reset;
+
+Reset connection cache.
+
 =head1 DEBUGGING
 
 You can set the C<DBI_TRACE> environment variable to get some advanced 
diagnostics information printed by L<DBI>.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/lib/SQL/Abstract/Pg.pm 
new/Mojo-Pg-4.21/lib/SQL/Abstract/Pg.pm
--- old/Mojo-Pg-4.20/lib/SQL/Abstract/Pg.pm     2020-10-01 15:43:50.000000000 
+0200
+++ new/Mojo-Pg-4.21/lib/SQL/Abstract/Pg.pm     2020-10-24 23:46:50.000000000 
+0200
@@ -202,10 +202,10 @@
 In many places (as supported by L<SQL::Abstract>) you can use the C<-json> 
unary op to encode JSON from Perl data
 structures.
 
-  # "update some_table set foo = '[1,2,3]' where bar = 23"
+  # "UPDATE some_table SET foo = '[1,2,3]' WHERE bar = 23"
   $abstract->update('some_table', {foo => {-json => [1, 2, 3]}}, {bar => 23});
 
-  # "select * from some_table where foo = '[1,2,3]'"
+  # "SELECT * FROM some_table WHERE foo = '[1,2,3]'"
   $abstract->select('some_table', '*', {foo => {'=' => {-json => [1, 2, 3]}}});
 
 =head1 INSERT
@@ -218,25 +218,22 @@
 pass C<DO NOTHING>, array references to pass C<DO UPDATE> with conflict 
targets and a C<SET> expression, scalar
 references to pass literal SQL and array reference references to pass literal 
SQL with bind values are supported.
 
-  # "insert into t (a) values ('b') on conflict do nothing"
+  # "INSERT INTO t (a) VALUES ('b') ON CONFLICT DO NOTHING"
   $abstract->insert('t', {a => 'b'}, {on_conflict => undef});
 
-  # "insert into t (a) values ('b') on conflict do nothing"
+  # "INSERT INTO t (a) VALUES ('b') ON CONFLICT DO NOTHING"
   $abstract->insert('t', {a => 'b'}, {on_conflict => \'do nothing'});
 
 This includes operations commonly referred to as C<upsert>.
 
-  # "insert into t (a) values ('b') on conflict (a) do update set a = 'c'"
+  # "INSERT INTO t (a) VALUES ('b') ON CONFLICT (a) DO UPDATE SET a = 'c'"
   $abstract->insert('t', {a => 'b'}, {on_conflict => [a => {a => 'c'}]});
 
-  # "insert into t (a, b) values ('c', 'd')
-  #  on conflict (a, b) do update set a = 'e'"
-  $abstract->insert(
-    't', {a => 'c', b => 'd'}, {on_conflict => [['a', 'b'] => {a => 'e'}]});
-
-  # "insert into t (a) values ('b') on conflict (a) do update set a = 'c'"
-  $abstract->insert(
-    't', {a => 'b'}, {on_conflict => \['(a) do update set a = ?', 'c']});
+  # "INSERT INTO t (a, b) VALUES ('c', 'd') ON CONFLICT (a, b) DO UPDATE SET a 
= 'e'"
+  $abstract->insert('t', {a => 'c', b => 'd'}, {on_conflict => [['a', 'b'] => 
{a => 'e'}]});
+
+  # "INSERT INTO t (a) VALUES ('b') ON CONFLICT (a) DO UPDATE SET a = 'c'"
+  $abstract->insert('t', {a => 'b'}, {on_conflict => \['(a) do update set a = 
?', 'c']});
 
 =head1 SELECT
 
@@ -249,36 +246,36 @@
 well as array references containing scalar references to pass literal SQL and 
array reference references to pass
 literal SQL with bind values.
 
-  # "select foo as bar from some_table"
+  # "SELECT foo AS bar FROM some_table"
   $abstract->select('some_table', [[foo => 'bar']]);
 
-  # "select foo, bar as baz, yada from some_table"
+  # "SELECT foo, bar AS baz, yada FROM some_table"
   $abstract->select('some_table', ['foo', [bar => 'baz'], 'yada']);
 
-  # "select extract(epoch from foo) as foo, bar from some_table"
-  $abstract->select('some_table', [\'extract(epoch from foo) as foo', 'bar']);
+  # "SELECT EXTRACT(EPOCH FROM foo) AS foo, bar FROM some_table"
+  $abstract->select('some_table', [\'extract(epoch from foo) AS foo', 'bar']);
 
-  # "select 'test' as foo, bar from some_table"
-  $abstract->select('some_table', [\['? as foo', 'test'], 'bar']);
+  # "SELECT 'test' AS foo, bar FROM some_table"
+  $abstract->select('some_table', [\['? AS foo', 'test'], 'bar']);
 
 =head2 JOIN
 
 The C<$source> argument now also accepts array references containing not only 
table names, but also array references
 with tables to generate C<JOIN> clauses for.
 
-  # "select * from foo join bar on (bar.foo_id = foo.id)"
+  # "SELECT * FROM foo JOIN bar ON (bar.foo_id = foo.id)"
   $abstract->select(['foo', ['bar', foo_id => 'id']]);
 
-  # "select * from foo join bar on (foo.id = bar.foo_id)"
+  # "SELECT * FROM foo JOIN bar ON (foo.id = bar.foo_id)"
   $abstract->select(['foo', ['bar', 'foo.id' => 'bar.foo_id']]);
 
-  # "select * from a join b on (b.a_id = a.id) join c on (c.a_id = a.id)"
+  # "SELECT * FROM a JOIN b ON (b.a_id = a.id) JOIN c ON (c.a_id = a.id)"
   $abstract->select(['a', ['b', a_id => 'id'], ['c', a_id => 'id']]);
 
-  # "select * from foo left join bar on (bar.foo_id = foo.id)"
+  # "SELECT * FROM foo LEFT JOIN bar ON (bar.foo_id = foo.id)"
   $abstract->select(['foo', [-left => 'bar', foo_id => 'id']]);
 
-  # "select * from a left join b on (b.a_id = a.id and b.a_id2 = a.id2)"
+  # "SELECT * FROM a LEFT JOIN b ON (b.a_id = a.id AND b.a_id2 = a.id2)"
   $abstract->select(['a', [-left => 'b', a_id => 'id', a_id2 => 'id2']]);
 
 =head2 ORDER BY
@@ -286,20 +283,20 @@
 Alternatively to the C<$order> argument accepted by L<SQL::Abstract> you can 
now also pass a hash reference with
 various options. This includes C<order_by>, which takes the same values as the 
C<$order> argument.
 
-  # "select * from some_table order by foo desc"
+  # "SELECT * FROM some_table ORDER BY foo DESC"
   $abstract->select('some_table', '*', undef, {order_by => {-desc => 'foo'}});
 
 =head2 LIMIT/OFFSET
 
 The C<limit> and C<offset> options can be used to generate C<SELECT> queries 
with C<LIMIT> and C<OFFSET> clauses.
 
-  # "select * from some_table limit 10"
+  # "SELECT * FROM some_table LIMIT 10"
   $abstract->select('some_table', '*', undef, {limit => 10});
 
-  # "select * from some_table offset 5"
+  # "SELECT * FROM some_table OFFSET 5"
   $abstract->select('some_table', '*', undef, {offset => 5});
 
-  # "select * from some_table limit 10 offset 5"
+  # "SELECT * FROM some_table LIMIT 10 OFFSET 5"
   $abstract->select('some_table', '*', undef, {limit => 10, offset => 5});
 
 =head2 GROUP BY
@@ -307,10 +304,10 @@
 The C<group_by> option can be used to generate C<SELECT> queries with C<GROUP 
BY> clauses. So far, array references to
 pass a list of fields and scalar references to pass literal SQL are supported.
 
-  # "select * from some_table group by foo, bar"
+  # "SELECT * FROM some_table GROUP BY foo, bar"
   $abstract->select('some_table', '*', undef, {group_by => ['foo', 'bar']});
 
-  # "select * from some_table group by foo, bar"
+  # "SELECT * FROM some_table GROUP BY foo, bar"
   $abstract->select('some_table', '*', undef, {group_by => \'foo, bar'});
 
 =head2 HAVING
@@ -318,7 +315,7 @@
 The C<having> option can be used to generate C<SELECT> queries with C<HAVING> 
clauses, which takes the same values as
 the C<$where> argument.
 
-  # "select * from t group by a having b = 'c'"
+  # "SELECT * FROM t GROUP BY a HAVING b = 'c'"
   $abstract->select('t', '*', undef, {group_by => ['a'], having => {b => 
'c'}});
 
 =head2 FOR
@@ -326,10 +323,10 @@
 The C<for> option can be used to generate C<SELECT> queries with C<FOR> 
clauses. So far, the scalar value C<update> to
 pass C<UPDATE> and scalar references to pass literal SQL are supported.
 
-  # "select * from some_table for update"
+  # "SELECT * FROM some_table FOR UPDATE"
   $abstract->select('some_table', '*', undef, {for => 'update'});
 
-  # "select * from some_table for update skip locked"
+  # "SELECT * FROM some_table FOR UPDATE SKIP LOCKED"
   $abstract->select('some_table', '*', undef, {for => \'update skip locked'});
 
 =head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/t/crud.t new/Mojo-Pg-4.21/t/crud.t
--- old/Mojo-Pg-4.20/t/crud.t   2020-10-01 15:43:57.000000000 +0200
+++ new/Mojo-Pg-4.21/t/crud.t   2020-10-24 23:29:51.000000000 +0200
@@ -11,14 +11,14 @@
 
 # Isolate tests
 my $pg = Mojo::Pg->new($ENV{TEST_ONLINE})->search_path(['mojo_crud_test']);
-$pg->db->query('drop schema if exists mojo_crud_test cascade');
-$pg->db->query('create schema mojo_crud_test');
+$pg->db->query('DROP SCHEMA IF EXISTS mojo_crud_test CASCADE');
+$pg->db->query('CREATE SCHEMA mojo_crud_test');
 
 my $db = $pg->db;
 $db->query(
-  'create table if not exists crud_test (
-     id   serial primary key,
-     name text
+  'CREATE TABLE IF NOT EXISTS crud_test (
+     id   SERIAL PRIMARY KEY,
+     name TEXT
    )'
 );
 
@@ -74,9 +74,9 @@
 
 subtest 'Quoting' => sub {
   $db->query(
-    'create table if not exists crud_test2 (
-     id   serial primary key,
-     "t e s t" text
+    'CREATE TABLE IF NOT EXISTS crud_test2 (
+     id   SERIAL PRIMARY KEY,
+     "t e s t" TEXT
    )'
   );
   $db->insert('crud_test2',                {'t e s t' => 'foo'});
@@ -87,9 +87,9 @@
 
 subtest 'Arrays' => sub {
   $db->query(
-    'create table if not exists crud_test3 (
-     id   serial primary key,
-     names text[]
+    'CREATE TABLE IF NOT EXISTS crud_test3 (
+     id   SERIAL PRIMARY KEY,
+     names TEXT[]
    )'
   );
   $db->insert('crud_test3', {names => ['foo', 'bar']});
@@ -108,8 +108,8 @@
   is $result->{name}, 'promise', 'right result';
 
   $result = undef;
-  my $first  = $pg->db->query_p("select * from crud_test where name = 
'promise'");
-  my $second = $pg->db->query_p("select * from crud_test where name = 
'promise'");
+  my $first  = $pg->db->query_p("SELECT * FROM crud_test WHERE name = 
'promise'");
+  my $second = $pg->db->query_p("SELECT * FROM crud_test WHERE name = 
'promise'");
   Mojo::Promise->all($first, $second)->then(sub {
     my ($first, $second) = @_;
     $result = [$first->[0]->hash, $second->[0]->hash];
@@ -133,15 +133,15 @@
 
 subtest 'Join' => sub {
   $db->query(
-    'create table if not exists crud_test4 (
-     id    serial primary key,
-     test1 text
+    'CREATE TABLE IF NOT EXISTS crud_test4 (
+     id    SERIAL PRIMARY KEY,
+     test1 TEXT
    )'
   );
   $db->query(
-    'create table if not exists crud_test5 (
-     id    serial primary key,
-     test2 text
+    'CREATE TABLE IF NOT EXISTS crud_test5 (
+     id    SERIAL PRIMARY KEY,
+     test2 TEXT
    )'
   );
   $db->insert('crud_test4', {test1 => 'hello'});
@@ -152,6 +152,6 @@
 };
 
 # Clean up once we are done
-$pg->db->query('drop schema mojo_crud_test cascade');
+$pg->db->query('DROP SCHEMA mojo_crud_test CASCADE');
 
 done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/t/database.t 
new/Mojo-Pg-4.21/t/database.t
--- old/Mojo-Pg-4.20/t/database.t       2020-10-01 15:43:56.000000000 +0200
+++ new/Mojo-Pg-4.21/t/database.t       2020-10-25 18:08:15.000000000 +0100
@@ -19,12 +19,12 @@
 
 subtest 'Custom search_path' => sub {
   $pg = Mojo::Pg->new($ENV{TEST_ONLINE})->search_path(['$user', 'foo', 'bar']);
-  is_deeply $pg->db->query('show search_path')->hash, {search_path => 
'"$user", foo, bar'}, 'right structure';
+  is_deeply $pg->db->query('SHOW search_path')->hash, {search_path => 
'"$user", foo, bar'}, 'right structure';
   $pg = Mojo::Pg->new($ENV{TEST_ONLINE});
 };
 
 subtest 'Blocking select' => sub {
-  is_deeply $pg->db->query('select 1 as one, 2 as two, 3 as three')->hash, 
{one => 1, two => 2, three => 3},
+  is_deeply $pg->db->query('SELECT 1 AS one, 2 AS two, 3 AS three')->hash, 
{one => 1, two => 2, three => 3},
     'right structure';
 };
 
@@ -33,7 +33,7 @@
   my $same;
   my $db = $pg->db;
   $db->query(
-    'select 1 as one, 2 as two, 3 as three' => sub {
+    'SELECT 1 AS one, 2 AS two, 3 AS three' => sub {
       my ($db, $err, $results) = @_;
       $fail   = $err;
       $result = $results->hash;
@@ -52,9 +52,9 @@
   Mojo::IOLoop->delay(
     sub {
       my $delay = shift;
-      $pg->db->query('select 1 as one' => $delay->begin);
-      $pg->db->query('select 2 as two' => $delay->begin);
-      $pg->db->query('select 2 as two' => $delay->begin);
+      $pg->db->query('SELECT 1 AS one' => $delay->begin);
+      $pg->db->query('SELECT 2 AS two' => $delay->begin);
+      $pg->db->query('SELECT 2 AS two' => $delay->begin);
     },
     sub {
       my ($delay, $err_one, $one, $err_two, $two, $err_again, $again) = @_;
@@ -72,19 +72,19 @@
   Mojo::IOLoop->delay(
     sub {
       my $delay = shift;
-      $db->query('select 1 as one' => $delay->begin);
+      $db->query('SELECT 1 AS one' => $delay->begin);
     },
     sub {
       my ($delay, $err, $one) = @_;
       $fail = $err;
       push @$result, $one->hashes->first;
-      $db->query('select 1 as one' => $delay->begin);
+      $db->query('SELECT 1 AS one' => $delay->begin);
     },
     sub {
       my ($delay, $err, $again) = @_;
       $fail ||= $err;
       push @$result, $again->hashes->first;
-      $db->query('select 2 as two' => $delay->begin);
+      $db->query('SELECT 2 AS two' => $delay->begin);
     },
     sub {
       my ($delay, $err, $two) = @_;
@@ -115,20 +115,20 @@
 
 subtest 'Statement cache' => sub {
   my $db  = $pg->db;
-  my $sth = $db->query('select 3 as three')->sth;
-  is $db->query('select 3 as three')->sth,  $sth, 'same statement handle';
-  isnt $db->query('select 4 as four')->sth, $sth, 'different statement 
handles';
-  is $db->query('select 3 as three')->sth,  $sth, 'same statement handle';
+  my $sth = $db->query('SELECT 3 AS three')->sth;
+  is $db->query('SELECT 3 AS three')->sth,  $sth, 'same statement handle';
+  isnt $db->query('SELECT 4 AS four')->sth, $sth, 'different statement 
handles';
+  is $db->query('SELECT 3 AS three')->sth,  $sth, 'same statement handle';
   undef $db;
   $db = $pg->db;
-  my $results = $db->query('select 3 as three');
+  my $results = $db->query('SELECT 3 AS three');
   is $results->sth, $sth, 'same statement handle';
-  isnt $db->query('select 3 as three')->sth, $sth, 'different statement 
handles';
-  $sth = $db->query('select 3 as three')->sth;
-  is $db->query('select 3 as three')->sth,  $sth, 'same statement handle';
-  isnt $db->query('select 5 as five')->sth, $sth, 'different statement 
handles';
-  isnt $db->query('select 6 as six')->sth,  $sth, 'different statement 
handles';
-  is $db->query('select 3 as three')->sth,  $sth, 'same statement handle';
+  isnt $db->query('SELECT 3 AS three')->sth, $sth, 'different statement 
handles';
+  $sth = $db->query('SELECT 3 AS three')->sth;
+  is $db->query('SELECT 3 AS three')->sth,  $sth, 'same statement handle';
+  isnt $db->query('SELECT 5 AS five')->sth, $sth, 'different statement 
handles';
+  isnt $db->query('SELECT 6 AS six')->sth,  $sth, 'different statement 
handles';
+  is $db->query('SELECT 3 AS three')->sth,  $sth, 'same statement handle';
 };
 
 subtest 'Connection reuse' => sub {
@@ -141,42 +141,42 @@
   undef $results;
   my $db3 = $pg->db;
   is $db3->dbh, $dbh, 'same database handle';
-  $results = $db3->query('select 2');
+  $results = $db3->query('SELECT 2');
   is $results->db->dbh, $dbh, 'same database handle';
   is $results->array->[0], 2, 'right result';
 };
 
 subtest 'Dollar only' => sub {
   my $db = $pg->db;
-  is $db->dollar_only->query('select $1::int as test', 23)->hash->{test}, 23, 
'right result';
-  eval { $db->dollar_only->query('select ?::int as test', 23) };
+  is $db->dollar_only->query('SELECT $1::INT AS test', 23)->hash->{test}, 23, 
'right result';
+  eval { $db->dollar_only->query('SELECT ?::INT AS test', 23) };
   like $@, qr/Statement has no placeholders to bind/, 'right error';
-  is $db->query('select ?::int as test', 23)->hash->{test}, 23, 'right result';
+  is $db->query('SELECT ?::INT AS test', 23)->hash->{test}, 23, 'right result';
 };
 
 subtest 'JSON' => sub {
   my $db = $pg->db;
-  is_deeply $db->query('select ?::json as foo', {json => {bar => 
'baz'}})->expand->hash, {foo => {bar => 'baz'}},
+  is_deeply $db->query('SELECT ?::JSON AS foo', {json => {bar => 
'baz'}})->expand->hash, {foo => {bar => 'baz'}},
     'right structure';
-  is_deeply $db->query('select ?::jsonb as foo', {json => {bar => 
'baz'}})->expand->hash, {foo => {bar => 'baz'}},
+  is_deeply $db->query('SELECT ?::JSONB AS foo', {json => {bar => 
'baz'}})->expand->hash, {foo => {bar => 'baz'}},
     'right structure';
-  is_deeply $db->query('select ?::json as foo', {json => {bar => 
'baz'}})->expand->array, [{bar => 'baz'}],
+  is_deeply $db->query('SELECT ?::JSON AS foo', {json => {bar => 
'baz'}})->expand->array, [{bar => 'baz'}],
     'right structure';
-  is_deeply $db->query('select ?::json as foo', {json => {bar => 
'baz'}})->expand->hashes->first,
+  is_deeply $db->query('SELECT ?::JSON AS foo', {json => {bar => 
'baz'}})->expand->hashes->first,
     {foo => {bar => 'baz'}}, 'right structure';
-  is_deeply $db->query('select ?::json as foo', {json => {bar => 
'baz'}})->expand->arrays->first, [{bar => 'baz'}],
+  is_deeply $db->query('SELECT ?::JSON AS foo', {json => {bar => 
'baz'}})->expand->arrays->first, [{bar => 'baz'}],
     'right structure';
-  is_deeply $db->query('select ?::json as foo', {json => {bar => 
'baz'}})->hash, {foo => '{"bar":"baz"}'},
+  is_deeply $db->query('SELECT ?::JSON AS foo', {json => {bar => 
'baz'}})->hash, {foo => '{"bar":"baz"}'},
     'right structure';
-  is_deeply $db->query('select ?::json as foo', {json => 
\1})->expand->hashes->first, {foo => true}, 'right structure';
-  is_deeply $db->query('select ?::json as foo', undef)->expand->hash, {foo => 
undef}, 'right structure';
-  is_deeply $db->query('select ?::json as foo', undef)->expand->array, 
[undef], 'right structure';
-  my $results = $db->query('select ?::json', undef);
+  is_deeply $db->query('SELECT ?::JSON AS foo', {json => 
\1})->expand->hashes->first, {foo => true}, 'right structure';
+  is_deeply $db->query('SELECT ?::JSON AS foo', undef)->expand->hash, {foo => 
undef}, 'right structure';
+  is_deeply $db->query('SELECT ?::JSON AS foo', undef)->expand->array, 
[undef], 'right structure';
+  my $results = $db->query('SELECT ?::json', undef);
   is_deeply $results->expand->array, [undef], 'right structure';
   is_deeply $results->expand->array, undef, 'no more results';
-  is_deeply $db->query('select ?::json as unicode', {json => {'☃' => 
'♥'}})->expand->hash, {unicode => {'☃' => '♥'}},
+  is_deeply $db->query('SELECT ?::JSON AS unicode', {json => {'☃' => 
'♥'}})->expand->hash, {unicode => {'☃' => '♥'}},
     'right structure';
-  is_deeply $db->query("select json_build_object('☃', ?::text) as unicode", 
'♥')->expand->hash,
+  is_deeply $db->query("SELECT JSON_BUILD_OBJECT('☃', ?::TEXT) AS unicode", 
'♥')->expand->hash,
     {unicode => {'☃' => '♥'}}, 'right structure';
 };
 
@@ -218,14 +218,26 @@
   is $pg->db->dbh,  $dbh, 'same database handle';
   is $pg2->db->dbh, $dbh, 'same database handle';
   my $db = $pg->db;
-  is_deeply $db->query('select 1 as one')->hashes->to_array, [{one => 1}], 
'right structure';
+  is_deeply $db->query('SELECT 1 AS one')->hashes->to_array, [{one => 1}], 
'right structure';
   $dbh = $db->dbh;
   $db->disconnect;
   $db = $pg2->db;
-  is_deeply $db->query('select 1 as one')->hashes->to_array, [{one => 1}], 
'right structure';
+  is_deeply $db->query('SELECT 1 AS one')->hashes->to_array, [{one => 1}], 
'right structure';
   isnt $db->dbh, $dbh, 'different database handle';
 };
 
+subtest 'Cahce reset' => sub {
+  my $dbh = $pg->db->dbh;
+  is $pg->db->dbh, $dbh, 'same database handle';
+  is $pg->db->dbh, $dbh, 'same database handle again';
+  is $pg->db->dbh, $dbh, 'same database handle again';
+  isnt $pg->reset->db->dbh, $dbh, 'different database handle';
+  $dbh = $pg->db->dbh;
+  is $pg->db->dbh, $dbh, 'same database handle';
+  is $pg->db->dbh, $dbh, 'same database handle again';
+  isnt $pg->reset->db->dbh, $dbh, 'different database handle';
+};
+
 subtest 'Notifications' => sub {
   my $db = $pg->db;
   ok !$db->is_listening, 'not listening';
@@ -250,7 +262,7 @@
       my ($delay, $name, $pid, $payload) = @_;
       push @notifications, [$name, $pid, $payload];
       $db2->listen('dbtest2')->once(notification => $delay->begin);
-      Mojo::IOLoop->next_tick(sub { $db2->query("notify dbtest2, 'bar'") });
+      Mojo::IOLoop->next_tick(sub { $db2->query("NOTIFY dbtest2, 'bar'") });
     },
     sub {
       my ($delay, $name, $pid, $payload) = @_;
@@ -300,7 +312,7 @@
   my $close = 0;
   $db->on(close => sub { $close++ });
   local $db->dbh->{Warn} = 0;
-  $pg->db->query('select pg_terminate_backend(?)', $db->pid);
+  $pg->db->query('SELECT PG_TERMINATE_BACKEND(?)', $db->pid);
   Mojo::IOLoop->start;
   is $close, 1, 'close event has been emitted once';
 };
@@ -326,9 +338,9 @@
 
 subtest 'Non-blocking query in progress' => sub {
   my $db = $pg->db;
-  $db->query('select 1' => sub { });
+  $db->query('SELECT 1' => sub { });
   eval {
-    $db->query('select 1' => sub { });
+    $db->query('SELECT 1' => sub { });
   };
   like $@, qr/Non-blocking query already in progress/, 'right error';
 };
@@ -337,7 +349,7 @@
   my $fail;
   my $db = $pg->db;
   $db->query(
-    'select 1' => sub {
+    'SELECT 1' => sub {
       my ($db, $err, $results) = @_;
       $fail = $err;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/t/migrations/test.sql 
new/Mojo-Pg-4.21/t/migrations/test.sql
--- old/Mojo-Pg-4.20/t/migrations/test.sql      2019-11-21 17:51:00.000000000 
+0100
+++ new/Mojo-Pg-4.21/t/migrations/test.sql      2020-10-24 23:15:13.000000000 
+0200
@@ -1,10 +1,10 @@
 -- 1 up
-create table if not exists migration_test_three (baz varchar(255));
+CREATE TABLE IF NOT EXISTS migration_test_three (baz VARCHAR(255));
 -- 1 down
-drop table if exists migration_test_three;
+DROP TABLE IF EXISTS migration_test_three;
 -- 2 up
-insert into migration_test_three values ('just');
-insert into migration_test_three values ('works ♥');
+INSERT INTO migration_test_three VALUES ('just');
+INSERT INTO migration_test_three VALUES ('works ♥');
 -- 3 up
 -- 4 up
 does_not_exist;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/t/migrations.t 
new/Mojo-Pg-4.21/t/migrations.t
--- old/Mojo-Pg-4.20/t/migrations.t     2020-10-01 15:43:56.000000000 +0200
+++ new/Mojo-Pg-4.21/t/migrations.t     2020-10-24 23:29:49.000000000 +0200
@@ -12,8 +12,8 @@
 
 # Isolate tests
 my $pg = 
Mojo::Pg->new($ENV{TEST_ONLINE})->search_path(['mojo_migrations_test']);
-$pg->db->query('drop schema if exists mojo_migrations_test cascade');
-$pg->db->query('create schema mojo_migrations_test');
+$pg->db->query('DROP SCHEMA IF EXISTS mojo_migrations_test CASCADE');
+$pg->db->query('CREATE SCHEMA mojo_migrations_test');
 
 subtest 'Defaults' => sub {
   is $pg->migrations->name,   'migrations', 'right name';
@@ -39,43 +39,43 @@
 subtest 'Different syntax variations' => sub {
   $pg->migrations->name('migrations_test')->from_string(<<EOF);
 -- 1 up
-create table if not exists migration_test_one (foo varchar(255));
+CREATE TABLE IF NOT EXISTS migration_test_one (foo VARCHAR(255));
 
 -- 1down
 
-  drop table if exists migration_test_one;
+  DROP TABLE IF EXISTS migration_test_one;
 
   -- 2 up
 
-insert into migration_test_one values ('works ♥');
+INSERT INTO migration_test_one VALUES ('works ♥');
 -- 2 down
-delete from migration_test_one where foo = 'works ♥';
+DELETE FROM migration_test_one WHERE foo = 'works ♥';
 --
 --  3 Up, create
 --        another
 --        table?
-create table if not exists migration_test_two (bar varchar(255));
+CREATE TABLE IF NOT EXISTS migration_test_two (bar VARCHAR(255));
 --3  DOWN
-drop table if exists migration_test_two;
+DROP TABLE IF EXISTS migration_test_two;
 
 -- 10 up (not down)
-insert into migration_test_two values ('works too');
+INSERT INTO migration_test_two VALUES ('works too');
 -- 10 down (not up)
-delete from migration_test_two where bar = 'works too';
+DELETE FROM migration_test_two WHERE bar = 'works too';
 EOF
   is $pg->migrations->latest, 10, 'latest version is 10';
   is $pg->migrations->active, 0,  'active version is 0';
   is $pg->migrations->migrate->active, 10, 'active version is 10';
   ok !!(grep {/^mojo_migrations_test\.migration_test_one$/} 
@{$pg->db->tables}), 'first table exists';
   ok !!(grep {/^mojo_migrations_test\.migration_test_two$/} 
@{$pg->db->tables}), 'second table exists';
-  is_deeply $pg->db->query('select * from migration_test_one')->hash, {foo => 
'works ♥'}, 'right structure';
+  is_deeply $pg->db->query('SELECT * FROM migration_test_one')->hash, {foo => 
'works ♥'}, 'right structure';
   is $pg->migrations->migrate->active, 10, 'active version is 10';
   is $pg->migrations->migrate(1)->active,                      1,     'active 
version is 1';
-  is $pg->db->query('select * from migration_test_one')->hash, undef, 'no 
result';
+  is $pg->db->query('SELECT * FROM migration_test_one')->hash, undef, 'no 
result';
   is $pg->migrations->migrate(3)->active,                      3,     'active 
version is 3';
-  is $pg->db->query('select * from migration_test_two')->hash, undef, 'no 
result';
+  is $pg->db->query('SELECT * FROM migration_test_two')->hash, undef, 'no 
result';
   is $pg->migrations->migrate->active, 10, 'active version is 10';
-  is_deeply $pg->db->query('select * from migration_test_two')->hash, {bar => 
'works too'}, 'right structure';
+  is_deeply $pg->db->query('SELECT * FROM migration_test_two')->hash, {bar => 
'works too'}, 'right structure';
   is $pg->migrations->migrate(0)->active, 0, 'active version is 0';
 };
 
@@ -100,33 +100,33 @@
   my $pg3 = 
Mojo::Pg->new($ENV{TEST_ONLINE})->search_path(['mojo_migrations_test']);
   $pg3->migrations->name('migrations_test')->from_string(<<EOF);
 -- 5 up
-create table if not exists migration_test_six (foo varchar(255));
+CREATE TABLE IF NOT EXISTS migration_test_six (foo VARCHAR(255));
 -- 6 up
-insert into migration_test_six values ('works!');
+INSERT INTO migration_test_six VALUES ('works!');
 -- 5 down
-drop table if exists migration_test_six;
+DROP TABLE IF EXISTS migration_test_six;
 -- 6 down
-delete from migration_test_six;
+DELETE FROM migration_test_six;
 EOF
   $pg3->auto_migrate(1)->db;
   is $pg3->migrations->active, 6, 'active version is 6';
-  is_deeply $pg3->db->query('select * from migration_test_six')->hashes, [{foo 
=> 'works!'}], 'right structure';
+  is_deeply $pg3->db->query('SELECT * FROM migration_test_six')->hashes, [{foo 
=> 'works!'}], 'right structure';
   is $pg3->migrations->migrate(5)->active,                               5, 
'active version is 5';
-  is_deeply $pg3->db->query('select * from migration_test_six')->hashes, [], 
'right structure';
+  is_deeply $pg3->db->query('SELECT * FROM migration_test_six')->hashes, [], 
'right structure';
   is $pg3->migrations->migrate(0)->active,                               0, 
'active version is 0';
   is $pg3->migrations->sql_for(0, 5), <<EOF, 'right SQL';
 -- 5 up
-create table if not exists migration_test_six (foo varchar(255));
+CREATE TABLE IF NOT EXISTS migration_test_six (foo VARCHAR(255));
 EOF
   is $pg3->migrations->sql_for(6, 0), <<EOF, 'right SQL';
 -- 6 down
-delete from migration_test_six;
+DELETE FROM migration_test_six;
 -- 5 down
-drop table if exists migration_test_six;
+DROP TABLE IF EXISTS migration_test_six;
 EOF
   is $pg3->migrations->sql_for(6, 5), <<EOF, 'right SQL';
 -- 6 down
-delete from migration_test_six;
+DELETE FROM migration_test_six;
 EOF
   is $pg3->migrations->sql_for(6, 6), '', 'right SQL';
   is $pg3->migrations->sql_for(2, 3), '', 'right SQL';
@@ -137,8 +137,8 @@
   my $pg5 = Mojo::Pg->new($pg4);
   $pg4->auto_migrate(1)->migrations->name('test1')->from_data;
   $pg5->auto_migrate(1)->migrations->name('test3')->from_data;
-  is_deeply $pg5->db->query('select * from 
migration_test_four')->hashes->to_array, [{test => 10}], 'right structure';
-  is_deeply $pg5->db->query('select * from 
migration_test_six')->hashes->to_array, [], 'right structure';
+  is_deeply $pg5->db->query('SELECT * FROM 
migration_test_four')->hashes->to_array, [{test => 10}], 'right structure';
+  is_deeply $pg5->db->query('SELECT * FROM 
migration_test_six')->hashes->to_array, [], 'right structure';
 };
 
 subtest 'Unknown version' => sub {
@@ -149,15 +149,15 @@
 subtest 'Version mismatch' => sub {
   my $newer = <<EOF;
 -- 2 up
-create table migration_test_five (test int);
+CREATE TABLE migration_test_five (test INT);
 -- 2 down
-drop table migration_test_five;
+DROP TABLE migration_test_five;
 EOF
   $pg->migrations->name('migrations_test3')->from_string($newer);
   is $pg->migrations->migrate->active, 2, 'active version is 2';
   $pg->migrations->from_string(<<EOF);
 -- 1 up
-create table migration_test_five (test int);
+CREATE TABLE migration_test_five (test INT);
 EOF
   eval { $pg->migrations->migrate };
   like $@, qr/Active version 2 is greater than the latest version 1/, 'right 
error';
@@ -167,22 +167,22 @@
 };
 
 # Clean up once we are done
-$pg->db->query('drop schema mojo_migrations_test cascade');
+$pg->db->query('DROP SCHEMA mojo_migrations_test CASCADE');
 
 done_testing();
 
 __DATA__
 @@ test1
 -- 7 up
-create table migration_test_four (test int);
+CREATE TABLE migration_test_four (test INT);
 
 -- 10 up
-insert into migration_test_four values (10);
+INSERT INTO migration_test_four VALUES (10);
 
 @@ test2
 -- 2 up
-create table migration_test_five (test int);
+CREATE TABLE migration_test_five (test INT);
 
 @@ test3
 -- 2 up
-create table migration_test_six (test int);
+CREATE TABLE migration_test_six (test INT);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/t/pg_lite_app.t 
new/Mojo-Pg-4.21/t/pg_lite_app.t
--- old/Mojo-Pg-4.20/t/pg_lite_app.t    2020-10-01 15:43:57.000000000 +0200
+++ new/Mojo-Pg-4.21/t/pg_lite_app.t    2020-10-24 23:29:51.000000000 +0200
@@ -13,27 +13,27 @@
 
 # Isolate tests
 my $pg = Mojo::Pg->new($ENV{TEST_ONLINE});
-$pg->db->query('drop schema if exists mojo_app_test cascade');
-$pg->db->query('create schema mojo_app_test');
+$pg->db->query('DROP SCHEMA IF EXISTS mojo_app_test CASCADE');
+$pg->db->query('CREATE SCHEMA mojo_app_test');
 
 helper pg => sub {
   state $pg = Mojo::Pg->new($ENV{TEST_ONLINE})->search_path(['mojo_app_test']);
 };
 
-app->pg->db->query('create table if not exists app_test (stuff text)');
-app->pg->db->query('insert into app_test values (?)', 'I ♥ Mojolicious!');
+app->pg->db->query('CREATE TABLE IF NOT EXISTS app_test (stuff TEXT)');
+app->pg->db->query('INSERT INTO app_test VALUES (?)', 'I ♥ Mojolicious!');
 
 get '/blocking' => sub {
   my $c  = shift;
   my $db = $c->pg->db;
   $c->res->headers->header('X-Ref' => refaddr $db->dbh);
-  $c->render(text => $db->query('select * from app_test')->hash->{stuff});
+  $c->render(text => $db->query('SELECT * FROM app_test')->hash->{stuff});
 };
 
 get '/non-blocking' => sub {
   my $c = shift;
   $c->pg->db->query(
-    'select * from app_test' => sub {
+    'SELECT * FROM app_test' => sub {
       my ($db, $err, $results) = @_;
       $c->res->headers->header('X-Ref' => refaddr $db->dbh);
       $c->render(text => $results->hash->{stuff});
@@ -62,6 +62,6 @@
 };
 
 # Clean up once we are done
-$pg->db->query('drop schema mojo_app_test cascade');
+$pg->db->query('DROP SCHEMA mojo_app_test CASCADE');
 
 done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/t/pubsub.t new/Mojo-Pg-4.21/t/pubsub.t
--- old/Mojo-Pg-4.20/t/pubsub.t 2020-10-01 15:43:55.000000000 +0200
+++ new/Mojo-Pg-4.21/t/pubsub.t 2020-10-24 23:29:49.000000000 +0200
@@ -127,7 +127,7 @@
         $pubsub->unlisten('pstest4');
       }
     );
-    $pg->db->query('select pg_terminate_backend(?)', $dbhs[0]{pg_pid});
+    $pg->db->query('SELECT PG_TERMINATE_BACKEND(?)', $dbhs[0]{pg_pid});
     $pg->dsn('dbi:Pg:badoption=1');
     Mojo::IOLoop->start;
     ok $dbhs[1], 'database handle';
@@ -148,7 +148,7 @@
   {
     local $dbhs[0]{Warn} = 0;
     $pg->pubsub->on(reconnect => sub { Mojo::IOLoop->stop });
-    $pg->db->query('select pg_terminate_backend(?)', $dbhs[0]{pg_pid});
+    $pg->db->query('SELECT PG_TERMINATE_BACKEND(?)', $dbhs[0]{pg_pid});
     Mojo::IOLoop->start;
     ok $dbhs[1], 'database handle';
     isnt $dbhs[0], $dbhs[1], 'different database handles';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojo-Pg-4.20/t/results.t new/Mojo-Pg-4.21/t/results.t
--- old/Mojo-Pg-4.20/t/results.t        2020-10-01 15:43:56.000000000 +0200
+++ new/Mojo-Pg-4.21/t/results.t        2020-10-24 23:29:50.000000000 +0200
@@ -24,18 +24,18 @@
 
 # Isolate tests
 my $pg = Mojo::Pg->new($ENV{TEST_ONLINE})->search_path(['mojo_results_test']);
-$pg->db->query('drop schema if exists mojo_results_test cascade');
-$pg->db->query('create schema mojo_results_test');
+$pg->db->query('DROP SCHEMA IF EXISTS mojo_results_test CASCADE');
+$pg->db->query('CREATE SCHEMA mojo_results_test');
 
 my $db = $pg->db;
 is_deeply $pg->search_path, ['mojo_results_test'], 'right search path';
 $db->query(
-  'create table if not exists results_test (
-     id   serial primary key,
-     name text
+  'CREATE TABLE IF NOT EXISTS results_test (
+     id   SERIAL PRIMARY KEY,
+     name TEXT
    )'
 );
-$db->query('insert into results_test (name) values (?)', $_) for qw(foo bar);
+$db->query('INSERT INTO results_test (name) VALUES (?)', $_) for qw(foo bar);
 
 subtest 'Tables' => sub {
   ok !!(grep {/^mojo_results_test\.results.test$/} @{$db->tables}), 'results 
table exists';
@@ -44,14 +44,14 @@
 };
 
 subtest 'Result methods' => sub {
-  is_deeply $db->query('select * from results_test')->rows,    2, 'two rows';
-  is_deeply $db->query('select * from results_test')->columns, ['id', 'name'], 
'right structure';
-  is_deeply $db->query('select * from results_test')->array,   [1,    'foo'],  
'right structure';
-  is_deeply $db->query('select * from results_test')->arrays->to_array, [[1, 
'foo'], [2, 'bar']], 'right structure';
-  is_deeply $db->query('select * from results_test')->hash, {id => 1, name => 
'foo'}, 'right structure';
-  is_deeply $db->query('select * from results_test')->hashes->to_array,
+  is_deeply $db->query('SELECT * FROM results_test')->rows,    2, 'two rows';
+  is_deeply $db->query('SELECT * FROM results_test')->columns, ['id', 'name'], 
'right structure';
+  is_deeply $db->query('SELECT * FROM results_test')->array,   [1,    'foo'],  
'right structure';
+  is_deeply $db->query('SELECT * FROM results_test')->arrays->to_array, [[1, 
'foo'], [2, 'bar']], 'right structure';
+  is_deeply $db->query('SELECT * FROM results_test')->hash, {id => 1, name => 
'foo'}, 'right structure';
+  is_deeply $db->query('SELECT * FROM results_test')->hashes->to_array,
     [{id => 1, name => 'foo'}, {id => 2, name => 'bar'}], 'right structure';
-  is $pg->db->query('select * from results_test')->text, "1  foo\n2  bar\n", 
'right text';
+  is $pg->db->query('SELECT * FROM results_test')->text, "1  foo\n2  bar\n", 
'right text';
 };
 
 subtest 'Custom database and results classes' => sub {
@@ -59,33 +59,33 @@
   $pg->database_class('MojoPgTest::Database');
   $db = $pg->db;
   is ref $db, 'MojoPgTest::Database', 'right class';
-  is ref $db->query('select 1'), 'MojoPgTest::Results', 'right class';
-  is_deeply $db->query('select * from results_test')->array_test, [1, 'foo'], 
'right structure';
+  is ref $db->query('SELECT 1'), 'MojoPgTest::Results', 'right class';
+  is_deeply $db->query('SELECT * from results_test')->array_test, [1, 'foo'], 
'right structure';
 };
 
 subtest 'JSON' => sub {
-  is_deeply $db->query('select ?::json as foo', {json => {bar => 
'baz'}})->expand->hash, {foo => {bar => 'baz'}},
+  is_deeply $db->query('SELECT ?::JSON AS foo', {json => {bar => 
'baz'}})->expand->hash, {foo => {bar => 'baz'}},
     'right structure';
-  is_deeply $db->query('select ?::json as foo', {-json => {bar => 
'baz'}})->expand->hash, {foo => {bar => 'baz'}},
+  is_deeply $db->query('SELECT ?::JSON AS foo', {-json => {bar => 
'baz'}})->expand->hash, {foo => {bar => 'baz'}},
     'right structure';
-  is_deeply $db->query('select ?::json as foo', {json => {bar => 
'baz'}})->expand->array, [{bar => 'baz'}],
+  is_deeply $db->query('SELECT ?::JSON AS foo', {json => {bar => 
'baz'}})->expand->array, [{bar => 'baz'}],
     'right structure';
   my $hashes = [{foo => {one => 1}, bar => 'a'}, {foo => {two => 2}, bar => 
'b'}];
   is_deeply $db->query(
-    "select 'a' as bar, ?::json as foo
-   union all
-   select 'b' as bar, ?::json as foo", {json => {one => 1}}, {json => {two => 
2}}
+    "SELECT 'a' AS bar, ?::JSON AS foo
+     UNION ALL
+     SELECT 'b' AS bar, ?::JSON AS foo", {json => {one => 1}}, {json => {two 
=> 2}}
   )->expand->hashes->to_array, $hashes, 'right structure';
   my $arrays = [['a', {one => 1}], ['b', {two => 2}]];
   is_deeply $db->query(
-    "select 'a' as bar, ?::json as foo
-   union all
-   select 'b' as bar, ?::json as foo", {json => {one => 1}}, {json => {two => 
2}}
+    "SELECT 'a' AS bar, ?::JSON AS foo
+     UNION ALL
+     SELECT 'b' AS bar, ?::JSON AS foo", {json => {one => 1}}, {json => {two 
=> 2}}
   )->expand->arrays->to_array, $arrays, 'right structure';
 };
 
 subtest 'Iterate' => sub {
-  my $results = $db->query('select * from results_test');
+  my $results = $db->query('SELECT * FROM results_test');
   is_deeply $results->array, [1, 'foo'], 'right structure';
   is_deeply $results->array, [2, 'bar'], 'right structure';
   is $results->array,        undef, 'no more results';
@@ -96,21 +96,21 @@
   Mojo::IOLoop->delay(
     sub {
       my $delay = shift;
-      $db->query('select name from results_test' => $delay->begin);
+      $db->query('SELECT name FROM results_test' => $delay->begin);
     },
     sub {
       my ($delay, $err, $results) = @_;
       $fail = $err;
       push @$result, $results->array;
       $results->finish;
-      $db->query('select name from results_test' => $delay->begin);
+      $db->query('SELECT name FROM results_test' => $delay->begin);
     },
     sub {
       my ($delay, $err, $results) = @_;
       $fail ||= $err;
       push @$result, $results->array_test;
       $results->finish;
-      $db->query('select name from results_test' => $delay->begin);
+      $db->query('SELECT name FROM results_test' => $delay->begin);
     },
     sub {
       my ($delay, $err, $results) = @_;
@@ -125,45 +125,45 @@
 subtest 'Transactions' => sub {
   {
     my $tx = $db->begin;
-    $db->query("insert into results_test (name) values ('tx1')");
-    $db->query("insert into results_test (name) values ('tx1')");
+    $db->query("INSERT INTO results_test (name) VALUES ('tx1')");
+    $db->query("INSERT INTO results_test (name) VALUES ('tx1')");
     $tx->commit;
   };
-  is_deeply $db->query('select * from results_test where name = ?', 
'tx1')->hashes->to_array,
+  is_deeply $db->query('SELECT * FROM results_test WHERE name = ?', 
'tx1')->hashes->to_array,
     [{id => 3, name => 'tx1'}, {id => 4, name => 'tx1'}], 'right structure';
   {
     my $tx = $db->begin;
-    $db->query("insert into results_test (name) values ('tx2')");
-    $db->query("insert into results_test (name) values ('tx2')");
+    $db->query("INSERT INTO results_test (name) VALUES ('tx2')");
+    $db->query("INSERT INTO results_test (name) VALUES ('tx2')");
   };
-  is_deeply $db->query('select * from results_test where name = ?', 
'tx2')->hashes->to_array, [], 'no results';
+  is_deeply $db->query('SELECT * FROM results_test WHERE name = ?', 
'tx2')->hashes->to_array, [], 'no results';
   eval {
     my $tx = $db->begin;
-    $db->query("insert into results_test (name) values ('tx3')");
-    $db->query("insert into results_test (name) values ('tx3')");
+    $db->query("INSERT INTO results_test (name) VALUES ('tx3')");
+    $db->query("INSERT INTO results_test (name) VALUES ('tx3')");
     $db->query('does_not_exist');
     $tx->commit;
   };
   like $@, qr/does_not_exist/, 'right error';
-  is_deeply $db->query('select * from results_test where name = ?', 
'tx3')->hashes->to_array, [], 'no results';
+  is_deeply $db->query('SELECT * FROM results_test WHERE name = ?', 
'tx3')->hashes->to_array, [], 'no results';
 };
 
 subtest 'Long-lived results' => sub {
-  my $results1 = $db->query('select 1 as one');
+  my $results1 = $db->query('SELECT 1 AS one');
   is_deeply $results1->hashes, [{one => 1}], 'right structure';
-  my $results2 = $db->query('select 1 as one');
+  my $results2 = $db->query('SELECT 1 AS one');
   undef $results1;
   is_deeply $results2->hashes, [{one => 1}], 'right structure';
 };
 
 subtest 'Custom data types' => sub {
-  $db->query('create table if not exists results_test2 (stuff bytea)');
+  $db->query('CREATE TABLE IF NOT EXISTS results_test2 (stuff BYTEA)');
   my $snowman = encode 'UTF-8', '☃';
-  $db->query('insert into results_test2 (stuff) values (?)', {value => 
$snowman, type => PG_BYTEA});
-  is_deeply $db->query('select * from results_test2')->hash, {stuff => 
$snowman}, 'right structure';
+  $db->query('INSERT INTO results_test2 (stuff) VALUES (?)', {value => 
$snowman, type => PG_BYTEA});
+  is_deeply $db->query('SELECT * FROM results_test2')->hash, {stuff => 
$snowman}, 'right structure';
 };
 
 # Clean up once we are done
-$pg->db->query('drop schema mojo_results_test cascade');
+$pg->db->query('DROP SCHEMA mojo_results_test CASCADE');
 
 done_testing();


Reply via email to