Skip to content

Commit

Permalink
fix create database pool json fields
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny-b committed Apr 4, 2019
1 parent 1438b2a commit 3e8ec3f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [v1.11.1] - 2019-04-04

- #222 Fix Create Database Pools json fields - @sunny-b

## [v1.11.0] - 2019-04-03

- #220 roll out vpc functionality - @jheimann
Expand Down
6 changes: 5 additions & 1 deletion databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ type DatabasePool struct {

// DatabaseCreatePoolRequest is used to create a new database connection pool
type DatabaseCreatePoolRequest struct {
Pool *DatabasePool `json:"pool"`
User string `json:"user"`
Name string `json:"name"`
Size int `json:"size"`
Database string `json:"db"`
Mode string `json:"mode"`
}

// DatabaseCreateUserRequest is used to create a new database user
Expand Down
12 changes: 5 additions & 7 deletions databases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,13 +690,11 @@ func TestDatabases_CreatePool(t *testing.T) {
})

got, _, err := client.Databases.CreatePool(ctx, dbID, &DatabaseCreatePoolRequest{
Pool: &DatabasePool{
Name: "pool",
Database: "db",
Size: 10,
User: "foo",
Mode: "transaction",
},
Name: "pool",
Database: "db",
Size: 10,
User: "foo",
Mode: "transaction",
})
require.NoError(t, err)
require.Equal(t, want, got)
Expand Down
2 changes: 1 addition & 1 deletion godo.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

const (
libraryVersion = "1.11.0"
libraryVersion = "1.11.1"
defaultBaseURL = "https://api.digitalocean.com/"
userAgent = "godo/" + libraryVersion
mediaType = "application/json"
Expand Down

0 comments on commit 3e8ec3f

Please sign in to comment.