自动映射sql表并生成用于orm操作的类

orm-creator的Python项目详细描述


说明

映射sql(mysql)表并自动生成orm类!啊! 这被证明是非常有用的,尤其是在表的数量很大的情况下

演示

从命令行

https://cloud.githubusercontent.com/assets/10980285/17341384/f58637a4-5911-11e6-9309-deb9c4ae3dd8.gif

作为python模块

https://cloud.githubusercontent.com/assets/10980285/17342191/a87677f4-5915-11e6-8cd1-7060eead65b3.gif

安装

使用此存储库

git clone http://github.com/shravan97/ORM-Creator
cd ORM-Creator
python setup.py install

使用pip

马上就来!

用法

usage: orm-creator [-h][-db DB][-t TABLES [TABLES ...]][-host HOST][-u UNAME][-o OUTFILE]

optional arguments:
  -h, --help            show this help message and exit
  -db DB                The name of database from which tables will have to
                      mapped
  -t TABLES [TABLES ...]
                      List of table names each separated by one or more
                      space
  -host HOST            Name of the MySql host For Eg., localhost ,
                      mysql.mydomain.com ,....etc
  -u UNAME              Your Mysql username
  -o OUTFILE            Output file name ,along with its extension and
                      absolute path For Eg. , /home/shravan97/Desktop/out.py

样品

作为命令行应用程序

orm-creator -u root -db demo -t users migrations -o /var/www/flaskApp/db.py

# The above statement maps `users` and `migrations` tables

作为模块

fromorm_creatorimportormCreatoroc=ormCreator(config,'demo',['users','migrations'],'/var/www/flaskApp/db.py')# config is stored as a dict . For eg. , config = {'uname':'root','password':'**','host':'localhost'}oc.generate_file()

请检查here

贡献

有什么好主意可以在这里实现吗?继续做一个拉动请求:微笑:! 你不妨把它作为一个问题来提出来here

贡献者

许可证

GNU通用公共许可v3(GPLV3)

https://cloud.githubusercontent.com/assets/10980285/16361582/a40f472a-3bb2-11e6-80c4-dd633af6c284.png

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java变量始终存储0值。为什么?   如何使用Java/REST将Azure blob从一个存储容器移动到另一个存储容器?   java将commons DBCP从1.2升级到1.4,我应该害怕吗?   java如何使用分隔符拆分字符串?   java使用数组读取json对象   java在groovy中切片字符串   交换数组java的两个邻域元素   java移动用于确定字符串是否为回文的逻辑   java Android应用程序在一个活动中崩溃   java Sparkjava将webapp文件夹设置为静态资源/模板的文件夹   java复杂条件表达式,用户易用。   java如何仅在表存在时从表中选择值   java I无法将数据从Recyclerview传递到其他活动   java数据结构最佳设计(大数据)   java Android从DatePickerDialogFragment中删除日历视图   java将数据从Firebase获取到片段   数组。sort()在java中运行不正常