Skip to content

Commit 3c6bef5

Browse files
committed
chore: update README
1 parent c0fada8 commit 3c6bef5

File tree

2 files changed

+18
-34
lines changed

2 files changed

+18
-34
lines changed

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,11 @@
77
[![version](https://img.shields.io/github/v/tag/pardnchiu/go-mysql-pool)](https://github.com/pardnchiu/go-mysql-pool/releases)
88
[![readme](https://img.shields.io/badge/readme-中文-blue)](https://github.com/pardnchiu/go-mysql-pool/blob/main/README.zh.md)
99

10-
## Features
10+
## Three key features
1111

1212
- **Read-Write Separation**: Support for independent read and write connection pool configurations to enhance database performance
1313
- **Query Builder**: Fluent SQL query building interface to prevent SQL injection
14-
- **Auto Reconnection**: Automatically re-establish connections when they fail
15-
- **Concurrency Safe**: Thread-safe connection management supporting high-concurrency access
16-
- **Slow Query Logging**: Automatically log queries exceeding threshold for performance tuning
17-
- **Dynamic Configuration**: Dynamically adjust connection pool size during runtime
1814
- **CRUD Operations**: Complete Create, Read, Update, Delete operation support
19-
- **Memory Efficient**: Connection pool-based resource management for optimal performance
2015

2116
## Dependencies
2217

@@ -28,7 +23,7 @@
2823

2924
### Installation
3025
```bash
31-
go get github.com/pardnchiu/golang-mysql-pool
26+
go get github.com/pardnchiu/go-mysql-pool
3227
```
3328

3429
### Initialization
@@ -39,7 +34,7 @@ import (
3934
"fmt"
4035
"log"
4136

42-
mysqlPool "github.com/pardnchiu/golang-mysql-pool"
37+
mysqlPool "github.com/pardnchiu/go-mysql-pool"
4338
)
4439

4540
func main() {
@@ -61,9 +56,6 @@ func main() {
6156
Charset: "utf8mb4",
6257
Connection: 5,
6358
},
64-
Log: &mysqlPool.Log{
65-
Path: "./logs/mysql-pool",
66-
},
6759
}
6860

6961
// Initialize connection pool
@@ -135,10 +127,10 @@ type DBConfig struct {
135127
}
136128

137129
type Log struct {
138-
Path string // Log directory path
139-
Stdout bool // Enable console output
140-
MaxSize int64 // Maximum file size before rotation
141-
MaxBackup int // Number of log files to retain
130+
Path string // Log directory path (default: ./logs/mysqlPool)
131+
Stdout bool // Enable console output (default: false)
132+
MaxSize int64 // Maximum file size before rotation (default: 16*1024*1024)
133+
MaxBackup int // Number of log files to retain (default: 5)
142134
}
143135
```
144136

@@ -240,7 +232,7 @@ result, err := pool.Write.
240232
Update()
241233
```
242234

243-
### Direct SQL Operations
235+
### SQL Operations
244236

245237
```go
246238
// Direct query

README.zh.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,11 @@
77
[![version](https://img.shields.io/github/v/tag/pardnchiu/go-mysql-pool)](https://github.com/pardnchiu/go-mysql-pool/releases)
88
[![readme](https://img.shields.io/badge/readme-English-blue)](https://github.com/pardnchiu/go-mysql-pool/blob/main/README.md)
99

10-
## 功能特色
10+
## 三大主軸
1111

1212
- **讀寫分離**:支援讀寫連線池配置,提升資料庫效能
1313
- **查詢建構器**:鏈式語法的 SQL 查詢建構介面,防止 SQL 注入攻擊
14-
- **自動重連**:連線失敗時自動重新建立連線
15-
- **並發安全**:執行緒安全的連線管理,支援高並發存取
16-
- **慢查詢日誌**:自動記錄超過閾值的查詢,便於效能調優
17-
- **動態配置**:運行時動態調整連線池大小
1814
- **CRUD 操作**:完整的新增、查詢、更新、刪除操作支援
19-
- **記憶體效率**:基於連線池的資源管理,實現最佳效能
2015

2116
## 依賴套件
2217

@@ -27,7 +22,7 @@
2722

2823
### 安裝
2924
```bash
30-
go get github.com/pardnchiu/golang-mysql-pool
25+
go get github.com/pardnchiu/go-mysql-pool
3126
```
3227

3328
### 初始化
@@ -38,7 +33,7 @@ import (
3833
"fmt"
3934
"log"
4035

41-
mysqlPool "github.com/pardnchiu/golang-mysql-pool"
36+
mysqlPool "github.com/pardnchiu/go-mysql-pool"
4237
)
4338

4439
func main() {
@@ -60,9 +55,6 @@ func main() {
6055
Charset: "utf8mb4",
6156
Connection: 5,
6257
},
63-
Log: &mysqlPool.Log{
64-
Path: "./logs/mysql-pool",
65-
},
6658
}
6759

6860
// 初始化連線池
@@ -134,16 +126,16 @@ type DBConfig struct {
134126
}
135127

136128
type Log struct {
137-
Path string // 日誌目錄路徑
138-
Stdout bool // 啟用控制台輸出
139-
MaxSize int64 // 檔案輪轉前的最大大小
140-
MaxBackup int // 保留的日誌檔案數量
129+
Path string // 日誌目錄路徑 (預設: ./logs/mysqlPool)
130+
Stdout bool // 啟用控制台輸出 (預設: false)
131+
MaxSize int64 // 檔案輪轉前的最大大小 (預設: 16*1024*1024)
132+
MaxBackup int // 保留的日誌檔案數量 (預設: 5)
141133
}
142134
```
143135

144-
## 支援的操作
136+
## 支持的操作
145137

146-
### 查詢建構器
138+
### 查詢建構
147139

148140
```go
149141
// 基本查詢
@@ -239,7 +231,7 @@ result, err := pool.Write.
239231
Update()
240232
```
241233

242-
### 直接 SQL 操作
234+
### SQL 操作
243235

244236
```go
245237
// 直接查詢

0 commit comments

Comments
 (0)