package
0.0.0-20240620074727-8634b1c283ff
Repository: https://github.com/homesnz/go-common.git
Documentation: pkg.go.dev

# Functions

Conn is the SQL database connection accessor.
ConnRedshift is the SQL database connection accessor.
CreateStringArray is a function that will create a string formatted to be used for Postgres Array types.
FloatFrom returns a new null.Float.
InitConnection creates a new new connection to the database and verifies that it succeeds.
InitConnectionRedshift creates a new new connection to the database and verifies that it succeeds.
InitORM initializes the ORM connection from the existing connection.
IntFrom converts a int64 to a NullInt64, and sets Valid automatically.
NowPointer is a convenience func that returns a pointer to time.Now().
ORM is the gorm wrapped SQL database connection.
ParseArray is a function that will allow you to extract an array of strings for a Postgress Array Type.
SetConnection manually sets the connection.
SetConnectionRedshift manually sets the connection.
SetORMConnection manually sets the ORM connection.
StringFrom converts a string to a NullString, and sets Valid automatically.
ToNullInt64 converts a int64 to a NullInt64, and sets Valid automatically.
ToNullString converts a string to a NullString, and sets Valid automatically.

# Variables

ConnBackoffTimeout is the duration before the backoff will timeout.
ErrUnableToConnectToDB is raised when a connection to the database cannot be established.
ErrUnableToParseDBConnection is raised when there are missing or invalid details for the database connection.
UseORM is a flag that controls if the ORM connection should be updated when the normal connection is updated.

# Structs

PG is a concrete implementation of a database connection.

# Type aliases

PGArray is a type of string slice that is directly usable in PostgreSQL queries.
RS is a concrete implementation of a Redshift connection.