{"id":23087624,"url":"https://github.com/exp-codes/pypdm-db","last_synced_at":"2025-04-03T16:45:43.776Z","repository":{"id":62354931,"uuid":"291375922","full_name":"EXP-Codes/pypdm-db","owner":"EXP-Codes","description":"sqlite/mysql 的 PDM 生成器","archived":false,"fork":false,"pushed_at":"2024-09-20T15:35:40.000Z","size":13260,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-02T21:18:21.451Z","etag":null,"topics":["bean","dao","pdm","programming","pypdm-db","pypi"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pypdm-db/","language":"Python","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/EXP-Codes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://lyy289065406.github.io/sponsor/"]}},"created_at":"2020-08-30T01:10:50.000Z","updated_at":"2024-09-20T15:34:53.000Z","dependencies_parsed_at":"2025-02-09T05:35:51.571Z","dependency_job_id":null,"html_url":"https://github.com/EXP-Codes/pypdm-db","commit_stats":null,"previous_names":["lyy289065406/pypdm-db"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EXP-Codes%2Fpypdm-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EXP-Codes%2Fpypdm-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EXP-Codes%2Fpypdm-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EXP-Codes%2Fpypdm-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EXP-Codes","download_url":"https://codeload.github.com/EXP-Codes/pypdm-db/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247043242,"owners_count":20874084,"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","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":["bean","dao","pdm","programming","pypdm-db","pypi"],"created_at":"2024-12-16T19:59:19.351Z","updated_at":"2025-04-03T16:45:43.743Z","avatar_url":"https://github.com/EXP-Codes.png","language":"Python","readme":"# pypdm-db\n\n\u003e mysql/sqlite 的 PDM 生成器\n\n------\n\n## 运行环境\n\n![](https://img.shields.io/badge/Python-3.8%2B-brightgreen.svg) ![](https://img.shields.io/badge/PyCharm-4.0.4%2B-brightgreen.svg)\n\n\n## 安装说明\n\n执行脚本： \n\n```\npython -m pip install --upgrade pip\npython -m pip install pypdm-db\n```\n\n\n## 使用指引\n\n示例代码可参考单元测试：\n\n- sqlite: [test_pypdm_sqlite.py](tests/test_pypdm_sqlite.py)\n- mysql: [test_pypdm_mysql.py](tests/test_pypdm_mysql.py)\n\n通过以下函数可生成对应数据库的连接对象：\n\n- `from pypdm.dbc._sqlite import SqliteDBC`\n- `from pypdm.dbc._mysql import MysqlDBC`\n\n通过函数 `from pypdm.builder import build` 可生成指定数据表的 PDM 文件。\n\n例如数据库中已有表 [`t_teachers`](tests/db/sqlite/init_db.sql) ，会在指定的 package 目录生成两个代码文件：\n\n- Bean 文件： [*/bean/t_teachers.py](tests/tmp/pdm/sqlite/bean/t_teachers.py)\n- DAO 文件：  [*/dao/t_teachers.py](tests/tmp/pdm/sqlite/dao/t_teachers.py)\n\n\n其中 Bean 文件与表 `t_teachers` 的表结构一一对应， DAO 文件则封装了针对表 `t_teachers` 的增删改查函数。利用这两个文件，就可以方便地对表 `t_teachers` 进行操作。\n\n\n","funding_links":["https://lyy289065406.github.io/sponsor/"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexp-codes%2Fpypdm-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexp-codes%2Fpypdm-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexp-codes%2Fpypdm-db/lists"}