Python ORM Bee V1.5.4 众多功能更新 (上传中央库 PYPI)
Pythone ORM Bee 是基于 Python 的 ORM 工具;DeepSeek有了ORM Bee开发效率提高十倍;
让你使用 Python 开发数据库应用更简单、高效!
pip install ormbee 简单命令即可安装
https://pypi.org/project/ormbee/
简单易用的 ORM,开发数据库很快
主要功能
1.5.4(2025·元宵节-情人节·LTS版)
3. 调整exception和select_paging
4. 添加PreparedSql支持自定义SQL方式操作DB
5. 更新toUpdateSQL方法
6. select_by_id
7. delete_by_id
8. select_fun
9. count
10. exist
11. create_table
12. index_normal
13. unique
往期回顾:
安装依赖包
在命令行输入以下命令:
pip install ormbee
快速开始:
1. 配置 db 连接信息
1.1.can custom your db Module
in bee.json or bee.properties set dbModuleName
1.1.can custom your db Module
in bee.json or bee.properties set dbModuleName
{ "dbName": "SQLite", "database": "bee.db", //default support: pymysql,sqlite3,cx_Oracle,psycopg2 (no need set) "dbModuleName":"sqlite3" }
#value is: MySql,SQLite,Oracle, #MySQL config #bee.db.dbName=MySQL #bee.db.host =localhost #bee.db.user =root #bee.db.password = #bee.db.database =bee #bee.db.port=3306 # SQLite bee.db.dbName=SQLite bee.db.database =bee.db
1.2.if do not want to use the default config file(bee.json or bee.properties),
can set the db_config info yourself.
# #mysql config = { 'dbName':'MySQL', 'host': 'localhost', # 数据库主机 'user': 'root', # 替换为您的 MySQL 用户名 'password': '', # 替换为您的 MySQL 密码 'database': 'bee', # 替换为您的数据库名称 'port':3306 } honeyConfig= HoneyConfig() honeyConfig.set_db_config_dict(config)
1.3.set connection directly:
config = { # 'dbName':'MySQL', 'host': 'localhost', # 数据库主机 'user': 'root', # 替换为您的 MySQL 用户名 'password': '', # 替换为您的 MySQL 密码 'database': 'bee', # 替换为您的数据库名称 'port':3306 } honeyConfig= HoneyConfig() honeyConfig.set_dbName("MySQL") conn = pymysql.connect(**config) factory=BeeFactory() factory.setConnection(conn)
2. 使用 Bee 操作数据库
class Orders: id = None name = None remark = None #can ignore def __repr__(self): return str(self.__dict__) class Student2: id = None name = None age = None remark = None addr = None def __repr__(self): return str(self.__dict__) from bee.api import Suid from bee.config import PreConfig if __name__=="__main__": #set bee.properties/bee.json config folder, can set project root for it PreConfig.config_folder_root_path="E:\\Bee-Project" # select record suid=Suid() orderList=suid.select(Orders()) #select all #insert orders=Orders() orders.id=1 orders.name="bee" orders.remark="test" suid=Suid() suid.insert(orders) #update/delete orders=Orders() orders.name="bee130" orders.ext="aaa" #实体没有字段,会被忽略。出去安全考虑 orders.id=1 suid = Suid() n1= suid.update(orders) n2= suid.delete(orders) print(n1) print(n2) #batch insert student0=Student2() student0.name = "bee" student1=Student2() student1.name = "bee1" student1.addr="" student1.age=40 entity_list=[] entity_list.append(student0) entity_list.append(student1) suidRich = SuidRich() insertNum = suidRich.insert_batch(entity_list) print(insertNum)
3. 其它功能:
bee.api.py 为主要的接口
Suid : 简单易用的 Select, Update, Insert, Delete 的接口;
SuidRich: 功能丰富的 Suid 接口,有分页,批量插入等;
PreparedSql: 自定义 sql, 可以让写自己书写性能高效的 sql 语句,接口封装更好用.
Suid: simple API for Select/Update/Insert/Delete
SuidRich : select_paging, insert_batch, select_first,select_by_id, delete_by_id,select_fun,count,exist,create_table,index_normal,unique
PreparedSql: select, select_dict, modify, modify_dict
诚邀您的加入!
如果您还想添加什么功能,请到评论区告诉我们 (技术交流群:479080944)。

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
🚀 Xinference v1.2.2 震撼发布!deepseek R1 蒸馏模型全面支持!
Xorbits Inference(Xinference)是一个 性能强大且功能全面的 分布式 推理框架。可用于大语言模型(LLM),语音识别模型,多模态模型等各种模型的推理。通过 Xorbits Inference,你可以轻松地 一键部署你自己的模型或内置的前沿开源模型 - https://github.com/xorbitsai/inference。无论你是研究者,开发者,或是数据科学家,都可以通过 Xorbits Inference 与最前沿的 AI 模型,发掘更多可能。 Xinference 的功能和亮点有: * 🌟 模型推理,轻而易举:大语言模型,语音识别模型,多模态模型的部署流程被大大简化。一个命令即可完成模型的部署工作。 * ⚡️ 前沿模型,应有尽有:框架内置众多中英文的前沿大语言模型,包括 baichuan,chatglm2 等,一键即可体验!内置模型列表还在快速更新中! * 🖥 异构硬件,快如闪电:通过 ggml,同时使用你的 GPU 与 CPU 进行推理,降低延迟,提高吞吐! * ⚙️ 接口调用,灵活多样:提供多种使用模型的接口,包括 OpenAI 兼容的 R...
- 下一篇
PHP 8.4.4 发布
PHP 8.4.4 现已发布,这是一个错误修复版本。具体更新内容包括: Core: 修复了错误GH-17234(Numeric parent hook 调用因断言而失败)。 修复了错误GH-16892(ini_parse_quantity() 无法解析以 0x0b 开头的输入)。 修复了错误GH-16886(ni_parse_quantity() 无法对 0x+0 发出警告)。 修复了错误GH-17222(__PROPERTY__ magic constant并非在所有常量表达式上下文中都起作用)。 修复了错误GH-17214(放宽了对继承final的 trait 方法的final+private警告)。 修复了 Windows 上系统程序执行期间的 NULL 运算。 修复了在 Windows 上检查 trailing spaces时可能出现的 OOB 问题。 修复了错误GH-17408(断言失败 Zend/zend_exceptions.c)。 修复 ZEND_AST_UNPACK 的 may_have_extra_named_args 标志。 修复 Windows 的 System...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- CentOS6,7,8上安装Nginx,支持https2.0的开启
- CentOS8,CentOS7,CentOS6编译安装Redis5.0.7
- SpringBoot2更换Tomcat为Jetty,小型站点的福音
- Jdk安装(Linux,MacOS,Windows),包含三大操作系统的最全安装
- CentOS7,8上快速安装Gitea,搭建Git服务器
- SpringBoot2整合MyBatis,连接MySql数据库做增删改查操作
- SpringBoot2全家桶,快速入门学习开发网站教程
- CentOS8安装MyCat,轻松搞定数据库的读写分离、垂直分库、水平分库
- CentOS8编译安装MySQL8.0.19
- CentOS7,CentOS8安装Elasticsearch6.8.6