Skip to content

Commit e5ab282

Browse files
committed
README.md
1 parent 8b7c219 commit e5ab282

File tree

3 files changed

+6
-59
lines changed

3 files changed

+6
-59
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
* Simplified README.md for godoc documentation in pkg.go.dev
2+
13
## v3.19.0
24
* Added public package `dsn` for making piped data source name (connection string)
35
* Marked `ydb.WithEndpoint`, `ydb.WithDatabase`, `ydb.WithSecure`, `ydb.WithInsecure` options as deprecated
46
* Moved `ydb.RegisterParser` to package `dsn`
5-
* Added version into all error and warm log messages
7+
* Added version into all error and warn log messages
68

79
## v3.18.5
810
* Fixed duplicating `WithPanicCallback` proxying to table config options

README.md

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -11,62 +11,7 @@
1111

1212
Supports `table`, `discovery`, `coordination`, `ratelimiter`, `scheme` and `scripting` clients for `YDB`.
1313

14-
```go
15-
import (
16-
"github.com/ydb-platform/ydb-go-sdk/v3"
17-
"github.com/ydb-platform/ydb-go-sdk/v3/table"
18-
"github.com/ydb-platform/ydb-go-sdk/v3/table/result/named"
19-
"github.com/ydb-platform/ydb-go-sdk/v3/table/types"
20-
)
21-
22-
db, err := ydb.New(ctx,
23-
ydb.WithConnectionString("grpcs://localhost:2135/?database=/local"),
24-
ydb.WithAnonymousCredentials(),
25-
)
26-
if err != nil {
27-
log.Fatal(err)
28-
}
29-
defer func() { _ = db.Close(ctx) }()
30-
err = db.Table().Do(
31-
ctx,
32-
func(ctx context.Context, s table.Session) (err error) {
33-
_, res, err := s.Execute(ctx,
34-
table.TxControl(
35-
table.BeginTx(table.WithSerializableReadWrite()), table.CommitTx(),
36-
),
37-
"DECLARE $myStr AS Utf8; SELECT 42 as id, $myStr as myStr",
38-
table.NewQueryParameters(
39-
table.ValueParam("$myStr", types.UTF8Value("test")),
40-
),
41-
)
42-
if err != nil {
43-
return err // for driver retry
44-
}
45-
defer func() { _ = res.Close() }()
46-
var (
47-
id int32
48-
myStr *string //optional value
49-
)
50-
for res.NextResultSet(ctx) {
51-
for res.NextRow() {
52-
err := res.ScanNamed(
53-
named.Required("id", &id),
54-
named.Optional("myStr", &myStr),
55-
)
56-
if err != nil {
57-
return err
58-
}
59-
fmt.Printf("got id %v, got mystr: %v\n", id, *myStr)
60-
}
61-
}
62-
return res.Err()
63-
},
64-
)
65-
if err != nil {
66-
log.Fatal(err)
67-
}
68-
```
69-
More examples of usage placed in [examples](https://github.com/ydb-platform/ydb-go-examples) repository.
14+
Simple example see in [example](example_table_test.go). More examples of usage placed in [examples](https://github.com/ydb-platform/ydb-go-examples) repository.
7015

7116
See also [CREDENTIALS.md](CREDENTIALS.md) about supported YDB credentials.
7217

dsn/dsn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
// ctx,
1111
// ydb.WithConnectionString(
1212
// New("endpoint", "database").WithSecure(false).String(),
13-
// ),
14-
//)
13+
// ),
14+
// )
1515

1616
// DSN helps to make connection string from separated endpoint and database
1717
type DSN interface {

0 commit comments

Comments
 (0)