redshiftutils

package
v0.0.73 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: MIT Imports: 11 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)

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