Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckLoadStatus ¶
func CheckLoadStatus(t *sql.Tx, manifestURL string) (scoop_protocol.LoadStatus, error)
CheckLoadStatus checks the status of a load into redshift
func CopyCredentials ¶
func CopyCredentials(credentials *credentials.Credentials) (accessCreds string)
CopyCredentials refreshes the redshift aws auth token aggressively
func EscapePGString ¶
EscapePGString is a poor attempt to escape strings in postgres Prefer using $1 syntax with additional argument to Exec when possible
Types ¶
type ManifestRowCopyRequest ¶
type ManifestRowCopyRequest struct { BuiltOn time.Time Schema string Name string ManifestURL string Credentials string }
ManifestRowCopyRequest is the redshift package's represntation of the manifest row copy object for a manifest row copy
type RSConnection ¶
RSConnection holds the actual connection to the redshift table
func BuildRSConnection ¶
func BuildRSConnection(pgConnect string, maxOpenConnections int) (*RSConnection, error)
BuildRSConnection builds and returns a new connection to redshift
func (*RSConnection) ExecCommand ¶
func (rs *RSConnection) ExecCommand(r RSRequest) (int, error)
ExecCommand is called by listen to initiate a transaction for a command for a RSRequest
func (*RSConnection) ExecFnInTransaction ¶
func (rs *RSConnection) ExecFnInTransaction(work func(*sql.Tx) error) error
ExecFnInTransaction takes a closure function of a request and runs it on redshift in a transaction
func (*RSConnection) ExecInTransaction ¶
func (rs *RSConnection) ExecInTransaction(cmds ...RSRequest) error
ExecInTransaction listens to multiple RSRequests and executes them in a single transaction
func (*RSConnection) Listen ¶
func (rs *RSConnection) Listen()
Listen continuously listens on inbound requests to exec on the RSconnection
type RSRequest ¶
type RSRequest interface { GetExec() string GetStartTime() time.Time GetCategory() string GetMessage() string GetResult(i int, err error) *RSResult }
RSRequest is the interface that defines all query creations on redshift
type RSResult ¶
RSResult represents the response from redshift after a query is run
func (*RSResult) GetResultMessage ¶
GetResultMessage returns the result message of RSResult
func (*RSResult) GetStatusCode ¶
GetStatusCode returns the status code of a RSResult