Skip to content

Commit

Permalink
fixed grpcs connection in examples to grpc connection
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyasnikov committed Feb 20, 2023
1 parent 7582eb4 commit b848ce8
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ go get -u github.com/ydb-platform/ydb-go-sdk/v3

* connect to YDB
```golang
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -72,7 +72,7 @@ import (

...

db, err := sql.Open("ydb", "grpcs://localhost:2135/local")
db, err := sql.Open("ydb", "grpc://localhost:2136/local")
if err != nil {
log.Fatal(err)
}
Expand Down
8 changes: 4 additions & 4 deletions SQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (

func main() {
// init native ydb-go-sdk driver
nativeDriver, err := ydb.Open(context.TODO(), "grpcs://localhost:2135/local",
nativeDriver, err := ydb.Open(context.TODO(), "grpc://localhost:2136/local",
// See many ydb.Option's for configure driver https://pkg.go.dev/github.com/ydb-platform/ydb-go-sdk/v3#Option
)
if err != nil {
Expand All @@ -66,7 +66,7 @@ import (
)

func main() {
db, err := sql.Open("ydb", "grpcs://localhost:2135/local")
db, err := sql.Open("ydb", "grpc://localhost:2136/local")
defer db.Close()
}
```
Expand All @@ -86,7 +86,7 @@ import (
"github.com/ydb-platform/ydb-go-sdk/v3/balancers"
)
...
nativeDriver, err := ydb.Open(context.TODO(), "grpcs://localhost:2135/local",
nativeDriver, err := ydb.Open(context.TODO(), "grpc://localhost:2136/local",
ydb.WithBalancer(
balancers.PreferLocationsWithFallback(
balancers.RandomChoice(), "a", "b",
Expand Down Expand Up @@ -338,7 +338,7 @@ err := retry.DoTx(context.TODO(), db, func(ctx context.Context, tx *sql.Tx) erro
## Accessing the native driver from `*sql.DB` <a name="unwrap"></a>

```go
db, err := sql.Open("ydb", "grpcs://localhost:2135/local")
db, err := sql.Open("ydb", "grpc://localhost:2136/local")
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion SQL_MIGRATION_v2_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Second way (making driver from connector) are different in `v2` and `v3`:
- in `v3`:
`ydb.Connector` creates `sql.driver.Connector` from native `YDB` driver, returns two results (`sql.driver..Connector` and error) and exclude some lazy driver initialization.
```go
nativeDriver, err := ydb.Open(context.TODO(), "grpcs://localhost:2135/local")
nativeDriver, err := ydb.Open(context.TODO(), "grpc://localhost:2136/local")
if err != nil {
// fallback on error
}
Expand Down
2 changes: 1 addition & 1 deletion coordination/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
//nolint:errcheck
func Example() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
Expand Down
4 changes: 2 additions & 2 deletions discovery/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func Example_discoverCluster() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
Expand All @@ -28,7 +28,7 @@ func Example_discoverCluster() {

func Example_whoAmI() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
Expand Down
10 changes: 5 additions & 5 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

func Example_table() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -58,7 +58,7 @@ func Example_table() {
}

func Example_databaseSQL() {
db, err := sql.Open("ydb", "grpcs://localhost:2135/local")
db, err := sql.Open("ydb", "grpc://localhost:2136/local")
if err != nil {
log.Fatal(err)
}
Expand All @@ -84,7 +84,7 @@ func Example_databaseSQL() {

func Example_topic() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed connect: %v", err)
return
Expand Down Expand Up @@ -115,7 +115,7 @@ func Example_topic() {

func Example_scripting() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
Expand Down Expand Up @@ -158,7 +158,7 @@ func Example_scripting() {

func Example_discovery() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
Expand Down
2 changes: 1 addition & 1 deletion meta/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func Example_consumedUnitsCount() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion ratelimiter/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func Example() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
Expand Down
2 changes: 1 addition & 1 deletion scheme/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func Example() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
Expand Down
8 changes: 4 additions & 4 deletions scripting/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func Example_execute() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
Expand Down Expand Up @@ -55,7 +55,7 @@ func Example_execute() {

func Example_streamExecute() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
Expand Down Expand Up @@ -99,7 +99,7 @@ func Example_streamExecute() {

func Example_explainPlan() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
Expand All @@ -123,7 +123,7 @@ func Example_explainPlan() {

func Example_explainValidate() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed to connect: %v", err)
return
Expand Down
10 changes: 5 additions & 5 deletions table/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

func Example_select() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed connect: %v", err)
return
Expand Down Expand Up @@ -59,7 +59,7 @@ func Example_select() {

func Example_createTable() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed connect: %v", err)
return
Expand Down Expand Up @@ -93,7 +93,7 @@ func Example_createTable() {

func Example_bulkUpsert() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed connect: %v", err)
return
Expand Down Expand Up @@ -148,7 +148,7 @@ func Example_bulkUpsert() {

func Example_alterTable() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed connect: %v", err)
return
Expand Down Expand Up @@ -183,7 +183,7 @@ func Example_alterTable() {

func Example_lazyTransaction() {
ctx := context.TODO()
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
fmt.Printf("failed connect: %v", err)
return
Expand Down
2 changes: 1 addition & 1 deletion topic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ go get -u github.com/ydb-platform/ydb-go-sdk/v3
## Example Usage <a name="example"></a>
* connect to YDB
```golang
db, err := ydb.Open(ctx, "grpcs://localhost:2135/local")
db, err := ydb.Open(ctx, "grpc://localhost:2136/local")
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit b848ce8

Please sign in to comment.