Closed tarkhil closed 3 years ago
We can only use the hooks SQL::Abstract
provides us. How they are handled we have no control over. You probably want to report the issue upstream.
So it was handled by SQL::Abstract, while being a Pg extension?... Ok...
On 17.01.2021 0:26, Sebastian Riedel wrote:
We can only use the hooks |SQL::Abstract| provides us. How they are handled we have no control over. You probably want to report the issue upstream.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mojolicious/mojo-pg/issues/74#issuecomment-761671301, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD4K55RYKDT6PPL7JZLRPLS2IABDANCNFSM4WFRVKJA.
As of 1.87. SQL::Abstract does not support JSON.
And as far as I understand SQL::Abstract::Pg manual, SQL::Abstract::Pg - should, as it's a Pg extension...
That doesn't mean we can magically change SQL::Abstract
internals.
@tarkhil I'm not sure exactly what SQL you are expecting to be generated, but if json()
is to be a function call in postgres, and its argument is a hashref, then this should do the trick:
$abstract->insert( 'some_table', {foo => \[ 'json(?)', [{}, [1,2,3] ] ]}, {bar => 23} );
Steps to reproduce the behavior
Actual behavior
Attempt to use that insert with Mojo::Pg yields "Cannot bind a reference" error