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
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
4540func 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
137129type 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
0 commit comments