ydb-platform / ydb-go-sdk

Pure Go native and database/sql driver for YDB
https://ydb.tech
Apache License 2.0
133 stars 69 forks source link

Fixed empty database in DSN while using config.WithDatabase #1253

Closed OS-M closed 1 month ago

OS-M commented 1 month ago

Pull request type

What is the current behavior?

Using empty database in ydb.Open with config.WithDatabase gives configuration: empty database at github.com/ydb-platform/ydb-go-sdk/v3.(*Driver).connect(driver.go:389) at github.com/ydb-platform/ydb-go-sdk/v3.Open(driver.go:266) error:

ydbOpts := []ydb.Option{
    ydb.WithDatabase("/local"),
}

_, err := ydb.Open(
    ctx,
    "grpc://localhost:2136",
    ydbOpts...,
)
if err != nil {
    panic(err.Error())
}

Issue Number: N/A

What is the new behavior?

Like in older versions of SDK (3.65.3 for sure), the code above connects to /local database.