Skip to content

Commit 0d0d55a

Browse files
committed
update
1 parent 567fee4 commit 0d0d55a

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

crates/rs-sql/readme.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# sqlx 用例:
2+
3+
- [sqlx](https://github.com/launchbadge/sqlx) 使用示例代码.
4+
5+
## packages:
6+
7+
-[rs-sqlcipher](rs-sqlcipher): rust + sqlx + sqlite 示例.
8+
9+
## 说明:
10+
11+
- sqlx 支持异步, 对数据库支持比较全. 使用多, bug 少.
12+
13+
## `Raw SQL` vs `ORM`:
14+
15+
- rust 当前 `ORM` 使用体验一般, 而且大多数场景, 使用 `ORM`,远远不如 `raw sql` 更灵活+高效.
16+
- 大厂的日常业务开发, 也基本是 `raw sql`, 几乎不使用ORM, 原因主要是 性能开销.
17+
- ORM, 多在 `admin API` 开发中使用, 这些场景, 对性能不敏感.
18+
19+
## RUST ORM:
20+
21+
- [sea-orm](https://github.com/SeaQL/sea-orm)
22+
- 基于 sqlx, 支持异步
23+
- [diesel](https://github.com/diesel-rs/diesel)
24+
- 不支持异步
25+
- [rbatis](https://github.com/rbatis/rbatis)
26+
- 国人项目
27+
28+
> 综合评价:
29+
30+
- 整体使用感受, 体验一般.
31+
- 没有特别舒服的. 可能不如直接使用 `sqlx`

0 commit comments

Comments
 (0)