google / sqlcommenter-laravel
SQLCommenter implementation for Laravel. SQLCommenter is a set of tools that augments SQL Statements with comments containing information about the code that caused its execution. These information can be action, controller, framework, db_driver, route and opentelemetry traceparent.
Installs: 73 052
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 4
Forks: 4
Open Issues: 2
Requires
- open-telemetry/opentelemetry: ~0.0.9
- php-http/guzzle7-adapter: ^1.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is not auto-updated.
Last update: 2024-11-18 08:52:18 UTC
README
sqlcommenter is a plugin/middleware/wrapper to augment SQL statements from laravel with comments that can be used later to correlate user code with SQL statements.
Installation
Add this to your composer.json
"repositories": [ { "type": "path", "url": "/full/or/relative/path/to/sqlcommenter-laravel/package" } ]
Install the package
composer require "google/sqlcommenter-laravel"
Usage
Publish the config file from library to into laravel app using below command
php artisan vendor:publish --provider="Google\GoogleSqlCommenterLaravel\GoogleSqlCommenterServiceProvider"
Add the following class above Illuminate\Database\DatabaseServiceProvider::class
,
in config/app.php
'providers' => [ ... Google\GoogleSqlCommenterLaravel\Database\DatabaseServiceProvider::class, Illuminate\Database\DatabaseServiceProvider::class, ... ]
Run unit tests
Run unit tests using below command
./vendor/bin/phpunit tests