redshiftutils

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTableByType added in v0.0.69

func CreateTableByType(tableName string, headers []string, tableType map[string]string) string

CreateTableByType is delegated to create the `CREATE TABLE` query for the given table tableName: Name of the table headers: List of headers necessary to preserve orders tableType: Map of headers:type for the given table

func MakeRedshfitConnection

func MakeRedshfitConnection(conf Conf) (*sql.DB, error)

func PhysicalDelete added in v0.0.77

func PhysicalDelete(connection *sql.DB) error

PhysicalDelete is delegated to perform the physical delete of the items marked as deleted

func SetAutoOptimization added in v0.0.77

func SetAutoOptimization(connection *sql.DB) error

SetAutoOptimization is delegated to scan all the tables in a redshift cluster and set the automatic diststyle and sortkey

Types

type Conf

type Conf struct {
	Username string      `json:"username"`
	Password string      `json:"password"`
	Host     string      `json:"host"`
	Port     json.Number `json:"port"`
	DBName   string      `json:"dbname"`
}

func (*Conf) Load added in v0.0.38

func (c *Conf) Load(confFile string) error

func (*Conf) Validate

func (c *Conf) Validate() error

type Result added in v0.0.71

type Result struct {
	Userid          int       `json:"userid,omitempty"`
	Slice           int       `json:"slice,omitempty"`
	Tbl             int       `json:"tbl,omitempty"`
	Starttime       time.Time `json:"starttime,omitempty"`
	Session         int       `json:"session,omitempty"`
	Query           int       `json:"query,omitempty"`
	Filename        string    `json:"filename,omitempty"`
	Line_number     int       `json:"line_number,omitempty"`
	Colname         string    `json:"colname,omitempty"`
	Type            string    `json:"type,omitempty"`
	Col_length      string    `json:"col_length,omitempty"`
	Position        int       `json:"position,omitempty"`
	Raw_line        string    `json:"raw_line,omitempty"`
	Raw_field_value string    `json:"raw_field_value,omitempty"`
	Err_code        int       `json:"err_code,omitempty"`
	Err_reason      string    `json:"err_reason,omitempty"`
	Is_partial      string    `json:"is_partial,omitempty"`
	Start_offset    string    `json:"start_offset,omitempty"`
}

func GetCOPYErrors added in v0.0.71

func GetCOPYErrors(connection *sql.DB) []Result

GetCOPYErrors is delegated to retrieve the loading error related to the COPY commands, sorted by time

func (*Result) Trim added in v0.0.71

func (r *Result) Trim()

Jump to

Keyboard shortcuts

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