-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Support for JSONB where clauses in PostgreSQL #134
Comments
Need some help or a bit of time to implement it. |
Yes, that would be great... |
Have you tried new Expression or Fragment syntax? It now supports optional parameters that make SQL composing for some dialects easier. |
Not yet, I've only been playing with this orm for the first few days. I will look in the near future when I will do some aggregations for jsonb columns en postgres... Thanx. |
@wolfy-j maybe you could help me build query with "WHERE json_column_name ? 'some string'"? I tried to use expression, but with no success ( ->where(new Expression("json_column_name ? 'some_value'"))
or
->where('json_column_name', '?', 'some_value') get me
|
When i switched driver to sqlite to take a look on the result sql in this case, i got expected error
When driver set to sqlite Escaping |
Can you give us the full example and query you are trying to build? |
Hello! https://bugs.php.net/bug.php?id=71885 "Question marks can be escaped by doubling them". But before i found it, i fixed my case with by replacing |
So I assume this issue is not an issue anymore? |
I well check how the question mark doubling works with ORM query builder. |
I checked escaping with doubling it - it work great with ORM too. $this->dbal->database('default')
->table('table')
->select('name')
->where(new Fragment(sprintf("field_name ?? '%s'", $textToFind)))
->fetchAll(); Thanks for your work. |
Is there any opportunity to find out if JSONB field contains one value or array of values using Cycle ORM ?
Example for Eloquent ORM:
$users = DB::table('users') ->whereJsonContains('options->languages', 'en') ->get();
$users = DB::table('users') ->whereJsonContains('options->languages', ['en', 'de']) ->get();
(https://laravel.com/docs/8.x/queries#json-where-clauses)
The text was updated successfully, but these errors were encountered: