ScientaNL / DoctrineJsonFunctions

Doctrine DQL functions for SQL JSON data type
MIT License
547 stars 50 forks source link

What is Postgresql configuration? #88

Closed Forticas closed 3 weeks ago

Forticas commented 1 year ago

Hello ,

this is symfony configuration for MySQL:

# config/packages/doctrine.yaml
doctrine:
    orm:
        dql:
            string_functions:
                JSON_EXTRACT: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql\JsonExtract
                JSON_SEARCH: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql\JsonSearch

What is the configuration for Postgresql? Thank's

chrisnoden commented 1 year ago

fundamentally the same, but the final definitions would be the Postgresql functions you want: eg

# config/packages/doctrine.yaml
doctrine:
    orm:
        dql:
            string_functions:
                JSONB_EXISTS: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonbExists
                JSONB_EXISTS_ANY: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonbExistsAny