pypdm-db
mysql/sqlite 的 PDM 生成器
运行环境
安装说明
执行脚本:
python -m pip install --upgrade pip
python -m pip install pypdm-db
使用指引
示例代码可参考单元测试:
- sqlite: test_pypdm_sqlite.py
- mysql: test_pypdm_mysql.py
通过以下函数可生成对应数据库的连接对象:
from pypdm.dbc._sqlite import SqliteDBCfrom pypdm.dbc._mysql import MysqlDBC
通过函数 from pypdm.builder import build 可生成指定数据表的 PDM 文件。
例如数据库中已有表 t_teachers ,会在指定的 package 目录生成两个代码文件:
- Bean 文件: */bean/t_teachers.py
- DAO 文件: */dao/t_teachers.py
其中 Bean 文件与表 t_teachers 的表结构一一对应, DAO 文件则封装了针对表 t_teachers 的增删改查函数。利用这两个文件,就可以方便地对表 t_teachers 进行操作。
Metadata
Release files for pypdm-db 1.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pypdm_db-1.1.6.tar.gz | 15.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pypdm_db-1.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.4 kB
Release files / pypdm_db-1.1.6.tar.gz
| Download URL | pypdm_db-1.1.6.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
208efdae1d5d03015afe3128c4eed18f04cc6a6d9488ebb44fcd7ee17b891a69
|
|
BLAKE2b-256 checksum How to use checksums |
d0d481dadb43c0fb64236e2a18013e40c046229f18f21c45758628b5d3f73f16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / pypdm_db-1.1.6-py3-none-any.whl
| Download URL | pypdm_db-1.1.6-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d06ed20ed5538729ee07bdb9791d19de38fc3b14db008f8fc6790b21f98efe77
|
|
BLAKE2b-256 checksum How to use checksums |
bf549a02efb3908e533fc09fd20b93e585a96447a39475e3774ee3c5bf0b8132
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|