martin-georgiev / postgresql-for-doctrine

PostgreSQL enhancements for Doctrine. Provides support for advanced data types (json, jssnb, arrays), text search, array operators and jsonb specific functions.

Home Page:https://packagist.org/packages/martin-georgiev/postgresql-for-doctrine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use TO_JSON with JSON_GET_FIELD_AS_TEXT

dmitryuk opened this issue · comments

I want to get sql like select (np.params::json)->> 'slug', np.params is a text field

DDL:

JSON_GET_FIELD_AS_TEXT(TO_JSON(np.params), 'slug')

Finally got an error:
Doctrine\ORM\Query\QueryException: [Syntax Error] line 0, col 110: Error: Expected Doctrine\ORM\Query\Lexer::T_INPUT_PARAMETER, got 'np'
What I do wrong?

Shall be resolved with the release of #116