{"id":37233073,"url":"https://github.com/levkopo/dbpp","last_synced_at":"2026-01-15T03:52:13.461Z","repository":{"id":57014266,"uuid":"363899196","full_name":"levkopo/dbpp","owner":"levkopo","description":"The library makes working with database easier and simpler","archived":true,"fork":false,"pushed_at":"2021-07-07T14:53:34.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T20:59:24.346Z","etag":null,"topics":["composer","database","orm","pdo","pdo-php","php-pdo","php8","sql-injection"],"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/levkopo.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-05-03T10:54:35.000Z","updated_at":"2023-11-23T12:00:22.000Z","dependencies_parsed_at":"2022-08-22T10:11:03.120Z","dependency_job_id":null,"html_url":"https://github.com/levkopo/dbpp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/levkopo/dbpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkopo%2Fdbpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkopo%2Fdbpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkopo%2Fdbpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkopo%2Fdbpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/levkopo","download_url":"https://codeload.github.com/levkopo/dbpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkopo%2Fdbpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["composer","database","orm","pdo","pdo-php","php-pdo","php8","sql-injection"],"created_at":"2026-01-15T03:52:12.881Z","updated_at":"2026-01-15T03:52:13.451Z","avatar_url":"https://github.com/levkopo.png","language":"PHP","readme":"# dbpp\ndbpp is a library that simplifies database queries by collecting them into one class.\n\n# **WARNING! Repository migrated to https://github.com/PPEco/dbpp**\n\n## Installation\ndbpp requires composer and php 8.0 or higher.\n\nFor installation run this command in composer:\n```\ncomposer require levkopo/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 (IDE may throw an error, but don't worry).\n\n```php\nclass TableDao extends Dao {\n    #[Query(\"SELECT * FROM `table`\")\n    public function getAll(): array|false {\n        parent::getAll();\n    }\n    \n    #[Query(\"SELECT * FROM `table` WHERE `id` = :id\")\n    public function getById(int $id){\n        parent::getAll($id);\n    }\n    \n    #[Insert(\"table\")\n    public function insert(Value $value): bool{\n        parent::insert($value);\n    }\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 call static method from DBPP: init\n```php\n$pdo = new PDO(*data*);\n$database = new SimpleDatabase();\nDBPP::init($database, $pdo);\n```\n\nNow you can call methods from the Database class\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevkopo%2Fdbpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevkopo%2Fdbpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevkopo%2Fdbpp/lists"}