pbergman/doctrine-export-bundle

Bundle for exporting query results.

1.0.0 2021-03-15 15:43 UTC

This package is auto-updated.

Last update: 2024-11-29 13:10:24 UTC


README

And bundle for exporting query results to different output types. This can be done by defining a query in the config or using the raw command directly.

Installing

composer require pbergman\doctrine-export-bundle

Usage

Configure a query:

p_bergman_doctrine_export:
  example:
      description: An example command
      query: |
        select 1,2,3

with the list command you can print a overview of all commands:

php bin/console pbergman:export:list
 ----------- ---------------------------------------------------------------------------------- 
  name                                   description                                                                       
 ----------- ---------------------------------------------------------------------------------- 
  example     An example command  
 ----------- ---------------------------------------------------------------------------------- 

and execute the command:

php bin/console pbergman:export:exec -F json
[{"1":"1","2":"2","3":"3"}]

or do a raw export:

php bin/console pbergman:export:raw -F json 'select 1,2,3'
[{"1":"1","2":"2","3":"3"}]