Skip to content

Commit a431646

Browse files
authored
Update README.md
1 parent 4fe4bff commit a431646

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

README.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,37 +42,7 @@ if err != nil {
4242
log.Fatal(err)
4343
}
4444
```
45-
* execute `SELECT` query over `Table` service client
46-
```go
47-
// Do retry operation on errors with best effort
48-
err := db.Table().Do(ctx, func(ctx context.Context, s table.Session) (err error) {
49-
_, res, err := s.Execute(ctx, table.DefaultTxControl(),
50-
`SELECT 42 as id, "myStr" as myStr;`,
51-
nil, // empty parameters
52-
)
53-
if err != nil {
54-
return err
55-
}
56-
defer res.Close()
57-
if err = res.NextResultSetErr(ctx); err != nil {
58-
return err
59-
}
60-
for res.NextRow() {
61-
var id int32
62-
var myStr string
63-
err = res.ScanNamed(named.Required("id", &id),named.OptionalWithDefault("myStr", &myStr))
64-
if err != nil {
65-
log.Fatal(err)
66-
}
67-
log.Printf("id=%v, myStr='%s'\n", id, myStr)
68-
}
69-
return res.Err() // for driver retry if not nil
70-
})
71-
if err != nil {
72-
log.Fatal(err)
73-
}
74-
```
75-
* execute `SELECT` query over `Query` service client
45+
* execute `SELECT` query with `Query` service client
7646
```go
7747
// Do retry operation on errors with best effort
7848
err := db.Query().Do( // Do retry operation on errors with best effort
@@ -149,6 +119,7 @@ Driver implements several ways for making credentials for `YDB`:
149119
- `ydb.WithAnonymousCredentials()` (enabled by default unless otherwise specified)
150120
- `ydb.WithAccessTokenCredentials("token")`
151121
- `ydb.WithStaticCredentials("user", "password")`,
122+
- `ydb.WithOauth2TokenExchangeCredentials()` and `ydb,WithOauth2TokenExchangeCredentialsFile(configFilePath)`
152123
- as part of connection string, like as `grpcs://user:password@endpoint/database`
153124

154125
Another variants of `credentials.Credentials` object provides with external packages:

0 commit comments

Comments
 (0)