redshift

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

README

redshift

-- import "github.com/Clever/redshifter/redshift"

Usage

type Redshift
type Redshift struct {
}

Redshift wraps a dbExecCloser and can be used to perform operations on a redshift database.

func NewRedshift
func NewRedshift() (*Redshift, error)

NewRedshift returns a pointer to a new redshift object using configuration values set in the flags.

func (*Redshift) CopyGzipCsvDataFromS3
func (r *Redshift) CopyGzipCsvDataFromS3(table, file, awsRegion string, delimiter rune) error

CopyGzipCsvDataFromS3 copies gzipped CSV data from an S3 file into a redshift table.

func (*Redshift) CopyJSONDataFromS3
func (r *Redshift) CopyJSONDataFromS3(table, file, jsonpathsFile, awsRegion string) error

CopyJSONDataFromS3 copies JSON data present in an S3 file into a redshift table.

func (*Redshift) RefreshTable
func (r *Redshift) RefreshTable(name, prefix, file, awsRegion string, ts postgres.TableSchema, delim rune) error

RefreshTable refreshes a single table by first copying gzipped CSV data into a temporary table and later renaming the temporary table to the original one.

func (*Redshift) RefreshTables
func (r *Redshift) RefreshTables(
	tables map[string]postgres.TableSchema, s3prefix, awsRegion string, delim rune) error

RefreshTables refreshes multiple tables in parallel and returns an error if any of the copies fail.

func (*Redshift) VacuumAnalyze
func (r *Redshift) VacuumAnalyze() error

VacuumAnalyze performs VACUUM FULL; ANALYZE on the redshift database. This is useful for recreating the indices after a database has been modified and updating the query planner.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redshift

type Redshift struct {
	// contains filtered or unexported fields
}

Redshift wraps a dbExecCloser and can be used to perform operations on a redshift database.

func NewRedshift

func NewRedshift() (*Redshift, error)

NewRedshift returns a pointer to a new redshift object using configuration values set in the flags.

func (*Redshift) CopyGzipCsvDataFromS3

func (r *Redshift) CopyGzipCsvDataFromS3(table, file, awsRegion string, delimiter rune) error

CopyGzipCsvDataFromS3 copies gzipped CSV data from an S3 file into a redshift table.

func (*Redshift) CopyJSONDataFromS3

func (r *Redshift) CopyJSONDataFromS3(table, file, jsonpathsFile, awsRegion string) error

CopyJSONDataFromS3 copies JSON data present in an S3 file into a redshift table.

func (*Redshift) RefreshTable

func (r *Redshift) RefreshTable(name, prefix, file, awsRegion string, ts postgres.TableSchema, delim rune) error

RefreshTable refreshes a single table by first copying gzipped CSV data into a temporary table and later renaming the temporary table to the original one.

func (*Redshift) RefreshTables

func (r *Redshift) RefreshTables(
	tables map[string]postgres.TableSchema, s3prefix, awsRegion string, delim rune) error

RefreshTables refreshes multiple tables in parallel and returns an error if any of the copies fail.

func (*Redshift) VacuumAnalyze

func (r *Redshift) VacuumAnalyze() error

VacuumAnalyze performs VACUUM FULL; ANALYZE on the redshift database. This is useful for recreating the indices after a database has been modified and updating the query planner.

Jump to

Keyboard shortcuts

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