Helpers to connect to YDB inside yandex-cloud.
Currently package provides helpers to connect to YDB inside yandex-cloud.
We follow the SemVer 2.0.0. In particular, we provide backward compatibility in the MAJOR releases. New features without loss of backward compatibility appear on the MINOR release. In the minor version, the patch number starts from 0. Bug fixes and internal changes are released with the third digit (PATCH) in the version.
There are, however, some changes with the loss of backward compatibility that we consider to be MINOR:
- extension or modification of internal ydb-go-ycinterfaces. We understand that this will break the compatibility of custom implementations of theydb-go-ycinternal interfaces. But we believe that the internal interfaces ofydb-go-ycare implemented well enough that they do not require custom implementation. We are working to ensure that all internal interfaces have limited access only insideydb-go-yc.
- major changes to (including removal of) the public interfaces and types that have been previously exported by ydb-go-yc. We understand that these changes will break the backward compatibility of early adopters of these interfaces. However, these changes are generally coordinated with early adopters and have the concise interfacing withydb-go-ycas a goal.
Internal interfaces outside from internal directory are marked with comment such as
// Warning: only for internal usage inside ydb-go-yc
We publish the planned breaking MAJOR changes:
- via the comment Deprecatedin the code indicating what should be used instead
- through the file NEXT_MAJOR_RELEASE.md
Requires Go 1.13 or later.
go get -u github.com/ydb-platform/ydb-go-ycimport (
    yc "github.com/ydb-platform/ydb-go-yc"
)
...
    db, err := ydb.Open(ctx, os.Getenv("YDB_CONNECTION_STRING"),
        yc.WithInternalCA(),
        yc.WithServiceAccountKeyFileCredentials("~/.ydb/sa.json"), // auth from service account key file
        // yc.WithMetadataCredentials(), // auth inside cloud (virual machine or yandex function)
    )