Skip to content

Latest commit

 

History

16 提交

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

仓库 files navigation

Amp SQL profiler bundle

If you use Amp with Symfony then you are probably based, but that means Doctrine will be useless (except perhaps its query builder), so you can't use the handy query profiler from DoctrineBundle. This is the missing SQL profiler for Amp.

Features

个人资料s Amp SQL connections in Symfony applications and displays the results in the Symfony 个人资料r toolbar.

  • Shows query summary in toolbar view.
  • Shows full query details in profiler view.
  • Supports transactions.
  • Supports backtraces.

Limitations

Using an unsupported feature may throw NotImplementedException.

  • Does not support prepared statements.
  • Does not support transaction save points.

Installation

Add the bundle to your project with Composer.

composer require --dev async/amp-sql-profiler-bundle

If Symfony Flex is installed, it should update bundles.php automatically with a line similar to the following.

ScriptFUSION\AmpSql个人资料rBundle\AmpSql个人资料rBundle::class => ['dev' => true, 'test' => true],

We recommend removing the 'test' key and only running the bundle in dev. If Flex is not available, the line can be added manually.

To enable profiling, all instances of Amp\Sql\Pool must be replaced with 个人资料dPool at dependency injection time. To do this, add the following line to services_dev.yaml.

  # Enable Amp SQL profiling.
  Amp\Sql\Pool:
    factory: '@ScriptFUSION\AmpSql个人资料rBundle\个人资料dPoolFactory'

Unfortunately, this will create a circular reference because 个人资料dPoolFactory creates an instance of 个人资料dPool which requires an instance of Amp\Sql\Pool. This can be resolved by specifying the specific implementation of the Pool that we want to profile. For example, the following configuration may suffice to profile Postgres.

  ScriptFUSION\AmpSql个人资料rBundle\个人资料dPool:
    arguments:
      - '@Amp\Postgres\PostgresConnectionPool'

  Amp\Postgres\PostgresConnectionPool: ~

关于

Amp SQL profiler for Symfony Web个人资料rBundle.

Resources

Stars

0 stars

关注者

1 watching

复刻s

发布

Used by

贡献者

Languages