{"id":33948671,"url":"https://github.com/ziyoren/database","last_synced_at":"2026-05-25T23:34:31.705Z","repository":{"id":57091459,"uuid":"318815573","full_name":"ziyoren/database","owner":"ziyoren","description":"A database component based on meboo, which can run in PHP FPM and swoole environment, and support database connection pool in swoole.","archived":false,"fork":false,"pushed_at":"2020-12-16T09:06:32.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-13T02:25:50.923Z","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/ziyoren.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":"2020-12-05T14:59:30.000Z","updated_at":"2021-11-03T08:21:37.000Z","dependencies_parsed_at":"2022-08-22T20:40:32.800Z","dependency_job_id":null,"html_url":"https://github.com/ziyoren/database","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ziyoren/database","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziyoren%2Fdatabase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziyoren%2Fdatabase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziyoren%2Fdatabase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziyoren%2Fdatabase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziyoren","download_url":"https://codeload.github.com/ziyoren/database/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziyoren%2Fdatabase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27688880,"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","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-12-12T18:47:16.094Z","updated_at":"2025-12-12T18:47:16.788Z","avatar_url":"https://github.com/ziyoren.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nA database component based on [meboo](https://github.com/catfan/Medoo), which can run in php-fpm and [swoole](https://github.com/swoole/swoole-src) environment, and support database connection pool in swoole.\n\n## Requirement\n* PHP7.1+\n* PDO extension installed.\n* Swoole 4.4+\n\n## Get Started\n\n### Install \n```\n$ composer require ziyoren/database\n```\n\n### update\n```\n$ composer update\n```\n\n### PDO Databases\n```php\nrequire 'vendor/autoload.php';\n\nuse ziyoren\\Database\\BaseModel; // swoole(支持数据库连接池)\n//use ziyoren\\Database\\PDO;       // 传统的php-fpm 无连接池\n\n//For database configuration, see ziyoren\\Database\\DbConfig.php\n$db = new BaseModel(); //swoole模式下使用\n//$db = new PDO(); //php-fpm模式下使用\n\n$db-\u003einsert('account', [\n    'user_name' =\u003e 'foo',\n    'email' =\u003e 'foo@bar.com'\n]);\n\n$data = $db-\u003eselect('account', [\n    'user_name',\n    'email'\n], [\n    'user_id' =\u003e 50\n]);\n\necho json_encode($data);\n```\n\n### Redis pools\n```php\nrequire 'vendor/autoload.php';\n\nuse ziyoren\\Database\\BaseRedis;\n\n//For Redis configuration, see /config/redis.php\n$redis = new BaseRedis();\n$redis-\u003eset('key', 'value');\n$rst = $redis-\u003eget('key');\n\necho $rst; //value\n```\n\n## License\n\nziyoren/database is under the MIT license.\n\n## Links\n* Databases Doc: [https://medoo.in/doc](https://medoo.in/doc)\n* Redis Doc: [https://github.com/phpredis/phpredis/blob/develop/README.markdown](https://medoo.in/doc)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziyoren%2Fdatabase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziyoren%2Fdatabase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziyoren%2Fdatabase/lists"}