Subject: | warnings while HASHREF in bind values |
Hello there!
For now Mojo::Pg use SQL::Abstract. Mojo::Pg and PostgreSQL support jsonb type, which is well mapped for Perl hash.
It would be nice, if SQL::Abstract will continue to allow use hashref as a bind value without any warnings (https://github.com/dbsrgits/sql-abstract/blob/bd805d8577ae84ee761522c88ff0f5ddeb42619b/lib/SQL/Abstract.pm#L332-L338)
Example:
$ cat t.pl
use Mojo::Pg;
my $pg = Mojo::Pg->new('postgresql://and@/test');
$pg->db->insert(tmp => {data => {json => {a => 13, b => 'test'}}});
$ perl t.pl
[SQL::Abstract::__ANON__] Warning: HASH ref as bind value in insert is not supported at /usr/local/share/perl/5.22.2/Mojo/Pg/Database.pm line 19.
$ psql test -c 'table tmp;'
id | data
----+------------------------
1 | {"a": 13, "b": "test"}
(1 row)
$
May be hashref will be actual for other databases too.