storage

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMalformedConnectionString = errors.New(
		"malformed database connection parameters provided",
	)
	ErrUnableToConnect = errors.New("unable to open connection to database")
)

Functions

func DBConnect

func DBConnect(driver string, connectionParams string) (*sql.DB, error)

DBConnect establishes a connection to the database using the driver and connection information. Only "postgres" is supported as the driver.

The following errors may be returned:

  • ErrMalformedConnectionString: The provided connection parameters are not in a valid format.
  • ErrUnableToConnect: Unable to make a connection to the database with the provided connection parameters.

func DBConnectionString

func DBConnectionString(cfg *configloader.ConnectionConfig) string

DBConnectionString generates a properly formatted connection string that can be used to establish a database connection. Note that it always creates a connection string with sslmode disabled.

Types

This section is empty.

Jump to

Keyboard shortcuts

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