Skip to content

add client/pool #584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Tested MySQL versions for the client include:
- 5.7.x
- 8.0.x

### Example for SELECT streaming (v.1.1.1)
### Example for SELECT streaming (v1.1.1)
You can use also streaming for large SELECT responses.
The callback function will be called for every result row without storing the whole resultset in memory.
`result.Fields` will be filled before the first callback call.
Expand All @@ -243,6 +243,21 @@ err := conn.ExecuteSelectStreaming(`select id, name from table LIMIT 100500`, &r
// ...
```

### Example for connection pool (v1.3.0)

```go
import (
"github.com/go-mysql-org/go-mysql/client"
)

pool := client.NewPool(log.Debugf, 100, 400, 5, "127.0.0.1:3306", `root`, ``, `test`)
// ...
conn, _ := pool.GetConn(ctx)
defer pool.PutConn(conn)

conn.Execute() / conn.Begin() / etc...
```

## Server

Server package supplies a framework to implement a simple MySQL server which can handle the packets from the MySQL client.
Expand Down
Loading