{"id":16390171,"url":"https://github.com/slamdunk/dbal-debugstack-middleware","last_synced_at":"2025-03-23T04:31:39.403Z","repository":{"id":212269619,"uuid":"731053642","full_name":"Slamdunk/dbal-debugstack-middleware","owner":"Slamdunk","description":"Doctrine\\DBAL middleware for precise query debugging in for \u003e= v3","archived":false,"fork":false,"pushed_at":"2025-03-18T17:01:17.000Z","size":118,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T17:51:29.823Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Slamdunk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["Slamdunk"],"custom":"https://paypal.me/filippotessarotto"}},"created_at":"2023-12-13T09:00:22.000Z","updated_at":"2025-03-08T01:45:11.000Z","dependencies_parsed_at":"2023-12-29T06:29:03.796Z","dependency_job_id":"bb4962e3-1c36-43bc-9d84-95d8f6dffd21","html_url":"https://github.com/Slamdunk/dbal-debugstack-middleware","commit_stats":null,"previous_names":["slamdunk/dbal-debugstack-middleware"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slamdunk%2Fdbal-debugstack-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slamdunk%2Fdbal-debugstack-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slamdunk%2Fdbal-debugstack-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slamdunk%2Fdbal-debugstack-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Slamdunk","download_url":"https://codeload.github.com/Slamdunk/dbal-debugstack-middleware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056889,"owners_count":20553855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T04:35:08.356Z","updated_at":"2025-03-23T04:31:39.096Z","avatar_url":"https://github.com/Slamdunk.png","language":"PHP","funding_links":["https://github.com/sponsors/Slamdunk","https://paypal.me/filippotessarotto"],"categories":[],"sub_categories":[],"readme":"# Slam\\DbalDebugstackMiddleware\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/slam/dbal-debugstack-middleware.svg)](https://packagist.org/packages/slam/dbal-debugstack-middleware)\n[![Downloads](https://img.shields.io/packagist/dt/slam/dbal-debugstack-middleware.svg)](https://packagist.org/packages/slam/dbal-debugstack-middleware)\n[![Integrate](https://github.com/Slamdunk/dbal-debugstack-middleware/workflows/CI/badge.svg)](https://github.com/Slamdunk/dbal-debugstack-middleware/actions)\n\nDoctrine\\DBAL middleware for precise query debugging (DebugStack replacement).\nCompared to the [default logging middleware](https://github.com/doctrine/dbal/pull/4967), this one:\n\n1. Tracks the query's execution time\n2. Doesn't handle exceptions\n3. Doesn't track disconnections\n\n## Installation\n\n`composer require slam/dbal-debugstack-middleware`\n\n## Usage\n\n```php\nuse Doctrine\\DBAL\\Configuration;\nuse Doctrine\\DBAL\\DriverManager;\nuse Doctrine\\DBAL\\ParameterType;\nuse Slam\\DbalDebugstackMiddleware\\DebugStack;\nuse Slam\\DbalDebugstackMiddleware\\Middleware;\n\n$debugStack = new DebugStack();\n\n$conn = DriverManager::getConnection(\n    $connectionParams,\n    (new Configuration)-\u003esetMiddlewares([\n        new Middleware($debugStack)\n    ])\n);\n\n$result = $conn-\u003eexecuteQuery(\n    'SELECT * FROM users WHERE active = :active',\n    ['active' =\u003e true],\n    ['active' =\u003e ParameterType::BOOLEAN],\n);\n\nprint_r($debugStack-\u003egetQueries());\n\n/*\n * Output:\n *\n    Array\n    (\n        [0] =\u003e Slam\\DbalDebugstackMiddleware\\Query Object\n            (\n                [sql] =\u003e SELECT * FROM users WHERE active = :active\n                [params] =\u003e Array\n                    (\n                        [active] =\u003e true\n                    )\n                [types] =\u003e Array\n                    (\n                        [active] =\u003e 5\n                    )\n                [executionMs] =\u003e 72.05312\n            )\n    )\n */\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslamdunk%2Fdbal-debugstack-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslamdunk%2Fdbal-debugstack-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslamdunk%2Fdbal-debugstack-middleware/lists"}