Skip to content

Commit 446c71c

Browse files
authored
Merge pull request #91 from planetscale/fatih-patch-1
Update README.md
2 parents 2e52ff6 + 2b05f74 commit 446c71c

File tree

1 file changed

+0
-46
lines changed

1 file changed

+0
-46
lines changed

README.md

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -96,49 +96,3 @@ client, _ := planetscale.NewClient(
9696
planetscale.WithAccessToken(token),
9797
)
9898
```
99-
100-
## Connecting to a PlanetScale Database
101-
102-
The `planetscale-go` package provides a helper method to simplify connecting to a PlanetScale database. Here is an example you can use (_Please make sure to handle errors in your production application._):
103-
104-
105-
```go
106-
package main
107-
108-
import (
109-
"context"
110-
"fmt"
111-
"os"
112-
113-
"github.com/planetscale/planetscale-go/planetscale"
114-
"github.com/planetscale/planetscale-go/planetscale/dbutil"
115-
)
116-
117-
func main() {
118-
token := os.Getenv("PLANETSCALE_TOKEN")
119-
ctx := context.Background()
120-
121-
// create a new PlanetScale API client with the given access token
122-
client, _ := planetscale.NewClient(
123-
planetscale.WithAccessToken(token),
124-
)
125-
126-
// create the Dial config
127-
dialCfg := &dbutil.DialConfig{
128-
Organization: "my-org",
129-
Database: "my-awesome-database",
130-
Branch: "my-branch",
131-
Client: client,
132-
}
133-
134-
// dbutil.Dial returns a ready to use *sql.DB instance.
135-
db, _ := dbutil.Dial(ctx, dialCfg)
136-
137-
// make a query
138-
var version string
139-
_ = db.QueryRow("SELECT VERSION()").Scan(&version)
140-
141-
// prints 'MySQL version: 8.0.23'
142-
fmt.Println("MySQL version:", version)
143-
}
144-
```

0 commit comments

Comments
 (0)