Using DoctrineExtensions with Symmfony and Sqlite

I am trying to use the DoctrineExtensions functions in a Symfony 5 project. I’ve added "beberlei/doctrineextensions": "^1.2", and here is my packages/doctrine.yaml file:

doctrine:
    dbal:
        url: '%env(resolve:DATABASE_URL)%'

        # IMPORTANT: You MUST configure your server version,
        # either here or in the DATABASE_URL env var (see .env file)
        #server_version: '5.7'
    orm:
        auto_generate_proxy_classes: true
        naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
        auto_mapping: true
        mappings:
            App:
                is_bundle: false
                type: annotation
                dir: '%kernel.project_dir%/src/Entity'
                prefix: 'AppEntity'
                alias: App
        dql:
            datetime_functions:
                MONTH: DoctrineExtensionsQuerySqliteMonth

But when querying with:

    $this->from('mytable', 't');
    $this->select('MONTH(created_date) as month');

I get SQLSTATE[HY000]: General error: 1 no such function: MONTH. Any ideas what I missing here?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *