a library for generating PDM of mysql/sqlite
Project description
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 SqliteDBC
from 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
进行操作。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pypdm_db-1.1.6.tar.gz
(15.9 kB
view details)
Built Distribution
pypdm_db-1.1.6-py3-none-any.whl
(13.4 kB
view details)
File details
Details for the file pypdm_db-1.1.6.tar.gz
.
File metadata
- Download URL: pypdm_db-1.1.6.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 208efdae1d5d03015afe3128c4eed18f04cc6a6d9488ebb44fcd7ee17b891a69 |
|
MD5 | ad777d5e270b1e73301fc3757f615a12 |
|
BLAKE2b-256 | d0d481dadb43c0fb64236e2a18013e40c046229f18f21c45758628b5d3f73f16 |
File details
Details for the file pypdm_db-1.1.6-py3-none-any.whl
.
File metadata
- Download URL: pypdm_db-1.1.6-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d06ed20ed5538729ee07bdb9791d19de38fc3b14db008f8fc6790b21f98efe77 |
|
MD5 | 6b3b8993976e929e4ac1b77d08243aba |
|
BLAKE2b-256 | bf549a02efb3908e533fc09fd20b93e585a96447a39475e3774ee3c5bf0b8132 |