{"id":36254367,"url":"https://github.com/ppeco/dbpp","last_synced_at":"2026-01-11T07:04:45.624Z","repository":{"id":57044183,"uuid":"383822020","full_name":"ppeco/dbpp","owner":"ppeco","description":"The library makes working with database easier and simpler","archived":false,"fork":false,"pushed_at":"2022-01-31T11:09:16.000Z","size":29,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-06T02:53:58.770Z","etag":null,"topics":["database","interface","pdo","php","ppeco","security-tools"],"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/ppeco.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}},"created_at":"2021-07-07T14:13:38.000Z","updated_at":"2024-05-08T11:37:18.000Z","dependencies_parsed_at":"2022-08-23T23:40:33.419Z","dependency_job_id":null,"html_url":"https://github.com/ppeco/dbpp","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/ppeco/dbpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppeco%2Fdbpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppeco%2Fdbpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppeco%2Fdbpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppeco%2Fdbpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppeco","download_url":"https://codeload.github.com/ppeco/dbpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppeco%2Fdbpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28296941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T04:44:51.577Z","status":"ssl_error","status_checked_at":"2026-01-11T04:44:44.232Z","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":["database","interface","pdo","php","ppeco","security-tools"],"created_at":"2026-01-11T07:04:45.054Z","updated_at":"2026-01-11T07:04:45.619Z","avatar_url":"https://github.com/ppeco.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dbpp\ndbpp is a library that simplifies database queries by collecting them into one class.\n\n## Installation\ndbpp requires composer and php 8.0 or higher.\n\nFor installation run this command in composer:\n```shell\ncomposer require ppeco/dbpp\n```\n\n## Usage\nThe main class for dbpp is Database.\nCreate a class extended from Database from dbpp.\n\n```php\nclass SimpleDatabase extends Database {\n\n}\n```\n\nCreate a class that will contain all the queries for a specific table.\nThe class should be extended from the Dao class from dbpp.\n\n```php\nclass TableDao extends Dao {\n\n}\n```\n\nCreate functions with query annotations from dbpp.\nThey can be Query and Insert.\nFunctions should call a function from parent.\n\n```php\nabstract class TableDao extends Dao {\n    #[Query(\"SELECT * FROM `table`\")]\n    public abstract function getAll(): array|false;\n    \n    #[Query(\"SELECT * FROM `table` WHERE `id` = :id\")]\n    public abstract function getById(int $id): array|false;\n    \n    #[Insert(\"INSERT `table`(`id`, `name`) VALUES(NULL, :name)\")]\n    public abstract function insert(string $name): bool;\n\n    #[Insert(\"INSERT `table`(`id`, `name`) VALUES(NULL, :name)\", ['id'])]\n    public abstract function insert2(string $name): int|bool;\n}\n```\n\nLink your Dao to Database via class properties.\n```php\nclass SimpleDatabase extends Database {\n   public TableDao $table;\n}\n```\n\nWell, the final steps. \nCreate PDO object and create Database class\n```php\n$pdo = new PDO(*data*);\n$database = new SimpleDatabase($pdo);\n```\n\nNow you can call methods from the Database class\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppeco%2Fdbpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppeco%2Fdbpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppeco%2Fdbpp/lists"}