-
-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB binding is wailing or broken with some PG operators #731
Comments
I build the followin binding using laravel core functionality to bind values when debug queries
but i'm unsure about everything inside closure
|
Hey, thanks for the report. Another issue in our implementation is an improper handling of ? characters inside 'quoted strings'. I think we can fix our regex to fix these cases, or we could just use Laravel's implementation. |
I've improved the query generation code in master (29095a5), can you please try if this solves your issue? |
PHP 8.3
Clockwork 5.3.*
DB: PostgreSQL 14.3 (any with json operations)
Prepare:
Case 1
Gives us wrong binding results


Case 2
Cause Fatal error
"message":"Undefined array key 1", "file":"/app/vendor/itsgoingd/clockwork/Clockwork/DataSource/EloquentDataSource.php:274"
Issue is in following preg pattern
$query = preg_replace_callback('/\?/', function ($matches) use ($bindings, $connection, &$index) {
it's not working with json operations like in PG: https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING
see Table 9.46. Additional jsonb Operators
jsonb ? text → boolean
jsonb @? jsonpath → boolean
See https://jdbc.postgresql.org/documentation/query/#using-the-statement-or-preparedstatement-interface
The text was updated successfully, but these errors were encountered: