Download the PHP package cerbero/sql-dumper without Composer
On this page you can find all versions of the php package cerbero/sql-dumper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sql-dumper
SQL Dumper
Laravel package to dump SQL queries, related EXPLAIN
and location in code in different formats:
- HTML
- markdown
- console
- log
Install
Via Composer
To customize some aspects of this package, the config/sql_dumper.php
file can optionally be generated via:
Usage
The easiest way to dump a SQL query is calling the helper functions. There is a helper for each dumper:
ds()
dump SQL queries with the dumper specified inconfig/sql_dumper.php
as default dumperdsConsole()
dump SQL queries with the console dumperdsEmail()
dump SQL queries with the email dumperdsHtml()
dump SQL queries with the html dumperdsLog()
dump SQL queries with the log dumperdsMarkdown()
dump SQL queries with the markdown dumper
All SQL queries executed within the helper's closure are dumped:
Depending on dumper and database driver, SQL queries dumps will look like:
console dump
email or HTML file or markdown file dump
log file dump
Along with the default dumper, in config/sql_dumper.php
we may customize the SQL dumpers default behavior. For example, the HTML dump default path is /storage/sql_dump_TIMESTAMP.html
but we can set a different one:
Also templates and email recipient are customizable, please refer to the [configuration][link-config] for further details.
This package includes a middleware to easily dump SQL queries in routes or group of routes. The middleware can be registered in app/Http/Kernel.php
:
Then we can add it to routes to run the default dumper:
If we want to use a different dumper, we can pass it to the middleware as a parameter:
The valid parameters are:
console
email
html
log
markdown
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
Contributing
Please see CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Andrea Sartori
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of sql-dumper with dependencies
illuminate/container Version >=5.6
illuminate/database Version >=5.6
illuminate/mail Version >=5.6
illuminate/support Version >=5.6
jdorn/sql-formatter Version ^1.2
symfony/console Version >=4.0