Documentation
¶
Overview ¶
Package connection contains the PGSQLConnection type and methods for manipulating and querying a PostgreSQL connection
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info interface {
NewConnection(database string) (*PGSQLConnection, error)
Hostname() string
}
Info holds all the information needed from the user to create a new connection
func DefaultConnectionInfo ¶
func DefaultConnectionInfo(al *args.ArgumentList) Info
DefaultConnectionInfo takes an argument list and constructs a default connection out of it
type MockInfo ¶
MockInfo is a mock struct which implements connection.Info
func (*MockInfo) NewConnection ¶
func (mi *MockInfo) NewConnection(database string) (*PGSQLConnection, error)
NewConnection creates a new mock info connection from the mockinfo struct
type PGSQLConnection ¶
type PGSQLConnection struct {
// contains filtered or unexported fields
}
PGSQLConnection represents a wrapper around a PostgreSQL connection
func CreateMockSQL ¶
func CreateMockSQL(t *testing.T) (con *PGSQLConnection, mock sqlmock.Sqlmock)
CreateMockSQL creates a Test SQLConnection. Must Close con when done
func (PGSQLConnection) Close ¶
func (p PGSQLConnection) Close()
Close closes the PosgreSQL connection. If an error occurs it is logged as a warning.
func (PGSQLConnection) Query ¶
func (p PGSQLConnection) Query(v interface{}, query string) error
Query runs a query and loads results into v