package sugar

import "github.com/ydb-platform/ydb-go-sdk/v3/sugar"

Index

Functions

func DSN

func DSN(endpoint, database string, secure bool) (s string)

DSN makes connection string (data source name) by endpoint, database and secure

func GenerateDeclareSection

func GenerateDeclareSection[T *table.QueryParameters | []table.ParameterOption | []sql.NamedArg](
	params T,
) (string, error)

GenerateDeclareSection generates DECLARE section text in YQL query by params

Warning: This is an experimental feature and could change at any time

func LoadCertificatesFromFile

func LoadCertificatesFromFile(caFile string) ([]*x509.Certificate, error)

LoadCertificatesFromFile read and parse caFile and returns certificates

func LoadCertificatesFromPem

func LoadCertificatesFromPem(bytes []byte) (certs []*x509.Certificate)

LoadCertificatesFromPem parse bytes and returns certificates

func MakeRecursive

func MakeRecursive(ctx context.Context, db ydb.Connection, pathToCreate string) error

MakeRecursive creates path inside database pathToCreate is a database root relative path MakeRecursive method equal bash command `mkdir -p ~/path/to/create` where `~` - is a root of database

func RemoveRecursive

func RemoveRecursive(ctx context.Context, db ydb.Connection, pathToRemove string) error

RemoveRecursive remove selected directory or table names in database. pathToRemove is a database root relative path All database entities in prefix path will remove if names list is empty. Empty prefix means than use root of database. RemoveRecursive method equal bash command `rm -rf ~/path/to/remove` where `~` - is a root of database

Source Files

certificates.go dsn.go params_go1.18.go path.go

Version
v3.37.3
Published
Aug 31, 2022
Platform
darwin/amd64
Imports
18 packages
Last checked
1 second ago

Tools for package owners.