Skip to main content

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

使用指引

示例代码可参考单元测试:

通过以下函数可生成对应数据库的连接对象:

  • from pypdm.dbc._sqlite import SqliteDBC
  • from pypdm.dbc._mysql import MysqlDBC

通过函数 from pypdm.builder import build 可生成指定数据表的 PDM 文件。

例如数据库中已有表 t_teachers ,会在指定的 package 目录生成两个代码文件:

其中 Bean 文件与表 t_teachers 的表结构一一对应, DAO 文件则封装了针对表 t_teachers 的增删改查函数。利用这两个文件,就可以方便地对表 t_teachers 进行操作。

Project details


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.4.tar.gz (14.3 kB view hashes)

Uploaded Source

Built Distribution

pypdm_db-1.1.4-py3-none-any.whl (13.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page