{"id":33987485,"url":"https://github.com/phpple/mysql","last_synced_at":"2026-05-29T03:31:55.728Z","repository":{"id":57040751,"uuid":"146263765","full_name":"phpple/mysql","owner":"phpple","description":"A PHP Mysql Graceful Library. With Features:sql builder,master/slave,table split,connection persist,etc.","archived":false,"fork":false,"pushed_at":"2020-07-23T08:58:46.000Z","size":58,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-14T17:44:09.090Z","etag":null,"topics":[],"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/phpple.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":"2018-08-27T07:41:59.000Z","updated_at":"2020-07-23T08:58:48.000Z","dependencies_parsed_at":"2022-08-23T22:00:09.242Z","dependency_job_id":null,"html_url":"https://github.com/phpple/mysql","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/phpple/mysql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpple%2Fmysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpple%2Fmysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpple%2Fmysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpple%2Fmysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpple","download_url":"https://codeload.github.com/phpple/mysql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpple%2Fmysql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33635961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"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-13T05:26:51.462Z","updated_at":"2026-05-29T03:31:55.712Z","avatar_url":"https://github.com/phpple.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Phpple Mysql\n=============\n\n`Phpple Mysql`一个基于PHP语言的Mysql类库，具有使用简单、操作优雅、代码严谨、效率优先等诸多优点。\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/phpple/mysql.svg?style=flat-square)](https://packagist.org/packages/phpple/mysql)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.0-8892BF.svg?style=flat-square)](https://php.net/)\n[![Build Status](https://img.shields.io/travis/phpple/mysql/master.svg?style=flat-square)](https://travis-ci.org/phpple/mysql)\n[![codecov](https://codecov.io/gh/phpple/mysql/branch/master/graph/badge.svg)](https://codecov.io/gh/phpple/mysql)\n\n\n`Phpple Mysql`提供如下优秀的特性：\n\n* SQL构建器\n* yield支持\n* 主/从库支持\n* 长连接支持\n* 分表/分库支持\n* psr-4支持\n\n### 使用示例\n\n```php\nuse Phpple\\Mysql\\Conf;\nuse Phpple\\Mysql\\Sql\\SqlBuilder;\nuse Phpple\\Mysql\\Db;\n\n// 初始化数据库配置\n$confs = [\n    'db' =\u003e [\n        'demo' =\u003e [\n            'dbname' =\u003e 'phpple',\n            'instance' =\u003e 'ip1'\n        ],\n    ],\n    'instance' =\u003e [\n        'ip1' =\u003e [\n            'host' =\u003e '127.0.0.1',\n            'port' =\u003e 3306,\n            'user' =\u003e 'root',\n            'pass' =\u003e '',\n            'charset' =\u003e 'utf8'\n        ],\n    ]\n];\nConf::init($confs);\n\n$id = 12030;\n// 创建一个Sql构建器\n$sqlBuilder = SqlBuilder::withTable('u_user')\n    -\u003efields('view_num')\n    -\u003esetData([\n        '@view_num' =\u003e '(view_num+1)'\n    ])\n    -\u003ewhere('id', $id);\n// 绑定Sql构建器到Db对象\n$db = Db::get('demo')-\u003esqlBuilder($sqlBuilder);\n\n// 获取原始view_num\n$viewNum = $db-\u003egetSingle();\necho 'before:' . $viewNum . PHP_EOL;\n\n// view_num 自增1\n$db-\u003eupdate();\n\n// 重新获取view_num\n$newViewnum = $db-\u003egetSingle();\necho 'after:' . $newViewnum . PHP_EOL;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpple%2Fmysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpple%2Fmysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpple%2Fmysql/lists"}