I'm trying to run a query with jsonb ? operator https://www.postgresql.org/docs/9.6/static/functions-json.html. In database console its ok, but i can't prepare it in laravel. Query like this:
SELECT * FROM game_user WHERE roles ? 'TRAINER'
I try DB::raw(), DB::statement() etc, but every time i have error:
SQLSTATE[42601]: Syntax error: 7 ERROR: Syntax error (near: "$1") LINE 1: SELECT id FROM game_user WHERE roles $1 'TRAINER' ^ (SQL: SELECT id FROM game_user WHERE roles ? 'TRAINER')
How i must do query without prepearing for arguments - ? to $1