docs.rs failed to build sz-orm-python-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
sz-orm — Python 绑定
Python bindings for sz-orm-core: async ORM with Model, QueryBuilder, Pool, Transaction.
安装
基本用法
# 构建 SQL(参数化查询)
=
, =
# sql = "SELECT * FROM `users` WHERE `id` = ?"
# params = [1]
# 模型
=
=
# 连接池
=
异步模型
异步方法(connect/acquire/execute)通过 pyo3-asyncio 桥接到 asyncio,需在 asyncio 事件循环内调用。
类型映射表
| Rust Value | Python 类型 |
|---|---|
| Null | None |
| Bool | bool |
| I8/I16/I32/I64 | int |
| U8/U16/U32/U64 | int |
| F32/F64 | float |
| Decimal | str |
| String | str |
| Bytes | bytes |
| Uuid/Date/DateTime/Time/Json | str (ISO 8601) |
| Array | list |
| Object | dict |
U64 大值说明
Python int 无精度限制,U64 大值(> 2^53)无精度丢失。