connection

package
v0.34.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrCantDetectUSer is the error used to notify that a default username is not found
	// in the system to be used as database username.
	ErrCantDetectUSer = errors.New("could not detect default username")
	// ErrInvalidPostgresURLFormat is the error used to notify that the postgres given url is not valid.
	ErrInvalidPostgresURLFormat = errors.New(
		"invalid url - valid format: postgres://user:password@host:port/db?sslmode=mode",
	)
	// ErrInvalidMySQLURLFormat is the error used to notify that the given mysql url is not valid.
	ErrInvalidMySQLURLFormat = errors.New(
		"invalid url - valid format: mysql://user:password@tcp(host:port)/db",
	)
	// ErrInvalidOracleURLFormat is the error used to notify the user that the oracle url is invalid.
	ErrInvalidOracleURLFormat = errors.New(
		"invalid url - valid format: oracle://user:pass@server/service_name",
	)
	// ErrInvalidURLFormat is used to notify the url is invalid.
	ErrInvalidURLFormat = errors.New("invalid url")
	// ErrInvalidDriver is used to notify that the provided driver is not supported.
	ErrInvalidDriver = errors.New("invalid driver")
	// ErrSocketFileDoNotExist indicates that the given path to the socket files leads to no file.
	ErrSocketFileDoNotExist = errors.New("socket file does not exist")
	// ErrInvalidSocketFile indicates that the socket file must end with .sock as suffix.
	ErrInvalidSocketFile = errors.New("invalid socket file - must end with .sock")
	// ErrInvalidOraclePort indicates that the port passed is not a proper integer.
	ErrInvalidOraclePort = errors.New("invalid oracle port")
)

Functions

func BuildConnectionFromOpts

func BuildConnectionFromOpts(opts command.Options) (string, command.Options, error)

BuildConnectionFromOpts return the connection uri string given the options passed by the uses.

func ValidateOpts

func ValidateOpts(opts command.Options) error

ValidateOpts make sure the important fields used to open a connection aren't empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL