driver

package
v0.0.0-...-d5f2c4f Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupported = errors.New("not supported")
	ErrDSNEmpty     = errors.New("dsn is empty")
	ErrConnClosed   = errors.New("connection closed")
	ErrBeforeCommit = errors.New("transaction is not committed")
	ErrNotInTx      = errors.New("not in transaction")
	ErrInTx         = errors.New("already in transaction")
)

Functions

func NewRedshiftConnector

func NewRedshiftConnector(cfg RedshiftConfig) driver.Connector

Types

type RedshiftConfig

type RedshiftConfig struct {
	Host       string            `mapstructure:"host,omitempty" json:"host,omitempty" yaml:"host,omitempty"`
	Port       int               `mapstructure:"port,omitempty" json:"port,omitempty" yaml:"port,omitempty"`
	Db         string            `mapstructure:"database,omitempty" json:"database,omitempty" yaml:"database,omitempty"`
	Schema     string            `mapstructure:"defaultSchema,omitempty" json:"defaultSchema,omitempty" yaml:"defaultSchema,omitempty"`
	Username   string            `mapstructure:"username,omitempty" json:"username,omitempty" yaml:"username,omitempty"`
	Password   string            `mapstructure:"password,omitempty" json:"password,omitempty" yaml:"password,omitempty"`
	Parameters map[string]string `mapstructure:"parameters,omitempty" json:"parameters,omitempty" yaml:"parameters,omitempty"`

	Serverless           bool   `mapstructure:"serverless,omitempty" json:"serverless,omitempty" yaml:"serverless,omitempty"`
	AuthenticationMethod string `mapstructure:"authenticationMethod,omitempty" json:"authenticationMethod,omitempty" yaml:"authenticationMethod,omitempty"`

	ClusterIdentifier   string        `mapstructure:"clusterIdentifier" json:"clusterIdentifier" yaml:"clusterIdentifier"`
	WorkgroupName       string        `mapstructure:"workgroupName" json:"workgroupName" yaml:"workgroupName"`
	SecretsARN          string        `json:"secretsARN"`
	SharedConfigProfile string        `json:"sharedConfigProfile"`
	SessionToken        string        `json:"sessionToken"`
	RoleARN             string        `mapstructure:"roleARN" json:"roleARN" yaml:"roleARN"`
	RoleARNExpiry       time.Duration `json:"roleARNExpiry"` // default: 15m
	ExternalID          string        `mapstructure:"externalID" json:"externalID" yaml:"externalID"`
	Timeout             time.Duration `json:"timeout"`          // default: no timeout
	MinPolling          time.Duration `json:"polling"`          // default: 10ms
	MaxPolling          time.Duration `json:"maxPolling"`       // default: 5s
	RetryMaxAttempts    int           `json:"retryMaxAttempts"` // default: 20

	// S3Config
	AccessKeyID     string `mapstructure:"accessKeyId,omitempty" json:"accessKeyId,omitempty" yaml:"accessKeyId,omitempty"`
	SecretAccessKey string `mapstructure:"secretAccessKey,omitempty" json:"secretAccessKey,omitempty" yaml:"secretAccessKey,omitempty"`
	Bucket          string `mapstructure:"bucket,omitempty" json:"bucket,omitempty" yaml:"bucket,omitempty"`
	Region          string `mapstructure:"region,omitempty" json:"region,omitempty" yaml:"region,omitempty"`
	Folder          string `mapstructure:"folder,omitempty" json:"folder,omitempty" yaml:"folder,omitempty"`

	Params url.Values
}

func ParseDSN

func ParseDSN(dsn string) (*RedshiftConfig, error)

func (*RedshiftConfig) GetMaxPolling

func (cfg *RedshiftConfig) GetMaxPolling() time.Duration

func (*RedshiftConfig) GetMinPolling

func (cfg *RedshiftConfig) GetMinPolling() time.Duration

func (*RedshiftConfig) GetRetryMaxAttempts

func (cfg *RedshiftConfig) GetRetryMaxAttempts() int

func (*RedshiftConfig) LoadOpts

func (cfg *RedshiftConfig) LoadOpts(ctx context.Context) ([]func(*config.LoadOptions) error, error)

func (*RedshiftConfig) Opts

func (cfg *RedshiftConfig) Opts() []func(*redshiftdata.Options)

func (*RedshiftConfig) Sanitize

func (cfg *RedshiftConfig) Sanitize()

func (*RedshiftConfig) String

func (cfg *RedshiftConfig) String() string

func (*RedshiftConfig) Validate

func (cfg *RedshiftConfig) Validate() error

Jump to

Keyboard shortcuts

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