Skip to content

Commit 7217029

Browse files
committed
docs: update README.md with enhanced feature documentation and badges
Changes include: - Added badges for Crates.io version, documentation, and license. - Expanded feature section to include flexible feature support for GaussDB and OpenGauss. - Provided detailed examples for configuring dependencies with different feature flags. - Updated documentation structure with new sections for feature guides and technical documentation. These updates improve the clarity and accessibility of the project's documentation.
1 parent fa42065 commit 7217029

File tree

6 files changed

+1665
-6
lines changed

6 files changed

+1665
-6
lines changed

CHANGELOG_FEATURES.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Feature 支持变更日志
2+
3+
## [0.1.1+] - 2025-10-31
4+
5+
### ✨ 新增
6+
7+
#### Feature 支持
8+
- 添加 `opengauss` feature(默认启用)
9+
- 添加 `gauss` feature(GaussDB 企业版)
10+
- 支持通过 Cargo features 灵活配置数据库特性
11+
12+
#### 条件编译
13+
- `cancel_query` API 和测试现在只在 `opengauss``gauss` feature 下可用
14+
- `domain` 类型测试只在 `opengauss``gauss` feature 下运行
15+
16+
### 📝 文档
17+
18+
- 新增 `FEATURES.md` - Feature 完整文档(英文)
19+
- 新增 `FEATURE_GUIDE_CN.md` - Feature 使用指南(中文)
20+
- 新增 `IMPLEMENTATION_SUMMARY.md` - 技术实现文档
21+
- 新增 `FEATURE_SUMMARY.md` - 快速参考
22+
23+
### 🔄 变更
24+
25+
#### gaussdb-protocol
26+
```toml
27+
[features]
28+
default = ["opengauss"]
29+
opengauss = []
30+
gauss = []
31+
```
32+
33+
#### tokio-gaussdb
34+
```toml
35+
[features]
36+
default = ["runtime", "opengauss"]
37+
runtime = ["tokio/net", "tokio/time"]
38+
opengauss = ["gaussdb-protocol/opengauss"]
39+
gauss = ["gaussdb-protocol/gauss"]
40+
```
41+
42+
#### gaussdb
43+
```toml
44+
[features]
45+
default = ["opengauss"]
46+
opengauss = ["tokio-gaussdb/opengauss"]
47+
gauss = ["tokio-gaussdb/gauss"]
48+
```
49+
50+
### ✅ 向后兼容
51+
52+
- **完全向后兼容** - 现有代码无需修改
53+
- 默认启用 `opengauss` feature,保持原有行为
54+
- 所有认证方法保持可用
55+
56+
### 🧪 测试
57+
58+
#### 测试变更
59+
- `gaussdb::test::cancel_query` - 添加 `#[cfg(feature = "opengauss")]`
60+
- `tokio_gaussdb::test::types::domain` - 添加 `#[cfg(feature = "opengauss")]`
61+
- `tokio_gaussdb::test::custom_domain` - 添加 `#[cfg(feature = "opengauss")]`
62+
63+
#### 测试结果
64+
- ✅ 默认配置: 18 个测试(含 cancel_query)
65+
- ✅ 无 features: 17 个测试(跳过 cancel_query)
66+
- ✅ 编译检查: 所有配置均通过
67+
68+
### 📊 Feature 对比
69+
70+
| 功能 | default | opengauss | gauss | 无 features |
71+
|------|---------|-----------|-------|------------|
72+
| PostgreSQL |||||
73+
| 认证方法 |||||
74+
| cancel_query |||||
75+
| domain 类型 |||||
76+
77+
### 🎯 使用示例
78+
79+
#### 默认(OpenGauss)
80+
```toml
81+
[dependencies]
82+
gaussdb = "0.1"
83+
```
84+
85+
#### GaussDB 企业版
86+
```toml
87+
[dependencies]
88+
gaussdb = { version = "0.1", default-features = false, features = ["gauss"] }
89+
```
90+
91+
#### 仅 PostgreSQL
92+
```toml
93+
[dependencies]
94+
gaussdb = { version = "0.1", default-features = false }
95+
```
96+
97+
### 🔧 编译选项
98+
99+
```bash
100+
# 默认编译
101+
cargo build
102+
103+
# GaussDB 编译
104+
cargo build --no-default-features --features gauss
105+
106+
# 最小编译
107+
cargo build --no-default-features
108+
109+
# 完整编译
110+
cargo build --all-features
111+
```
112+
113+
### 📚 相关文档
114+
115+
- [FEATURES.md](FEATURES.md) - 完整 Feature 文档
116+
- [FEATURE_GUIDE_CN.md](FEATURE_GUIDE_CN.md) - 中文使用指南
117+
- [IMPLEMENTATION_SUMMARY.md](IMPLEMENTATION_SUMMARY.md) - 实现细节
118+
119+
### 💡 设计决策
120+
121+
1. **默认 opengauss** - 保持向后兼容,OpenGauss 使用更广泛
122+
2. **认证始终可用** - 核心功能不受 feature 限制
123+
3. **测试条件编译** - 可选功能仅在需要时测试
124+
4. **灵活配置** - 用户可根据实际需求选择
125+
126+
### ⚠️ 注意事项
127+
128+
- `cancel_query` 测试在某些环境可能超时,这是已知问题
129+
- 禁用 features 会跳过相关测试,这是预期行为
130+
- 认证方法不受 feature 限制,始终可用
131+
132+
### 🔮 未来计划
133+
134+
- 完善 `gauss` feature 的差异化支持
135+
- 添加更多 OpenGauss/GaussDB 特有功能
136+
- 改进测试稳定性
137+
138+
---
139+
140+
**实施日期**: 2025-10-31
141+
**影响范围**: gaussdb-protocol, tokio-gaussdb, gaussdb
142+
**兼容性**: ✅ 完全向后兼容
143+

0 commit comments

Comments
 (0)