{"id":47907195,"url":"https://github.com/k-kinzal/ztd-query-php","last_synced_at":"2026-04-04T04:56:06.538Z","repository":{"id":337187202,"uuid":"1129700423","full_name":"k-kinzal/ztd-query-php","owner":"k-kinzal","description":"A Zero Table Dependency testing library","archived":false,"fork":false,"pushed_at":"2026-03-22T14:25:36.000Z","size":1505,"stargazers_count":0,"open_issues_count":168,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T04:56:05.668Z","etag":null,"topics":["cte","database","pdo","php","testing"],"latest_commit_sha":null,"homepage":"","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/k-kinzal.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-07T13:10:50.000Z","updated_at":"2026-03-09T14:02:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/k-kinzal/ztd-query-php","commit_stats":null,"previous_names":["k-kinzal/ztd-query-php"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/k-kinzal/ztd-query-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-kinzal%2Fztd-query-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-kinzal%2Fztd-query-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-kinzal%2Fztd-query-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-kinzal%2Fztd-query-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k-kinzal","download_url":"https://codeload.github.com/k-kinzal/ztd-query-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-kinzal%2Fztd-query-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31388169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cte","database","pdo","php","testing"],"created_at":"2026-04-04T04:56:05.879Z","updated_at":"2026-04-04T04:56:06.529Z","avatar_url":"https://github.com/k-kinzal.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZTD Query PHP\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PHP Version](https://img.shields.io/badge/PHP-8.1%2B-blue.svg)](https://www.php.net/)\n\nA Zero Table Dependency testing library for PHP 8.1+ that enables SQL unit testing without modifying physical databases.\n\nZTD Query PHP wraps PDO/MySQLi to intercept and transform SQL queries using CTE (Common Table Expression) shadowing. This allows you to test SQL queries against fixture data using the real MySQL engine, without migrations, data seeding, or cleanup.\n\n## Packages\n\n| Package | Description |\n|---------|-------------|\n| [ztd-query-core](packages/ztd-query-core/) | Core library: interfaces, session management, query routing |\n| [ztd-query-mysql](packages/ztd-query-mysql/) | MySQL platform: SQL parsing, classification, rewriting, schema reflection |\n| [ztd-query-pdo-adapter](packages/ztd-query-pdo-adapter/) | PDO adapter: drop-in `ZtdPdo` / `ZtdPdoStatement` |\n| [ztd-query-mysqli-adapter](packages/ztd-query-mysqli-adapter/) | MySQLi adapter: drop-in `ZtdMysqli` / `ZtdMysqliStatement` |\n| [sql-faker](packages/sql-faker/) | Faker provider for generating syntactically valid SQL |\n| [sql-fixture](packages/sql-fixture/) | Faker provider for generating test fixture data from schemas |\n\n## Quick Start\n\n```bash\ncomposer require --dev k-kinzal/ztd-query-pdo-adapter\n```\n\n```php\nuse ZtdQuery\\Adapter\\Pdo\\ZtdPdo;\n\n$pdo = new ZtdPdo('mysql:host=localhost;dbname=test', 'user', 'password');\n\n$pdo-\u003eexec('CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(255))');\n$pdo-\u003eexec(\"INSERT INTO users (id, name) VALUES (1, 'Alice')\");\n\n$stmt = $pdo-\u003eprepare('SELECT * FROM users WHERE id = ?');\n$stmt-\u003eexecute([1]);\n$result = $stmt-\u003efetchAll();\n// [['id' =\u003e 1, 'name' =\u003e 'Alice']]\n```\n\nSee [packages/ztd-query-core/README.md](packages/ztd-query-core/README.md) for full documentation.\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk-kinzal%2Fztd-query-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk-kinzal%2Fztd-query-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk-kinzal%2Fztd-query-php/lists"}