redshift

package
v4.0.0-...-227319a Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 12 Imported by: 0

README

Redshift

redshift://user:password@host:port/dbname?query

URL Query WithInstance Config Description
x-migrations-table MigrationsTable Name of the migrations table
dbname DatabaseName The name of the database to connect to
search_path This variable specifies the order in which schemas are searched when an object is referenced by a simple name with no schema specified.
user The user to sign in as
password The user's password
host The host to connect to. Values that start with / are for unix domain sockets. (default is localhost)
port The port to bind to. (default is 5439)
fallback_application_name An application_name to fall back to if one isn't provided.
connect_timeout Maximum wait for connection, in seconds. Zero or not specified means wait indefinitely.
sslcert Cert file location. The file must contain PEM encoded data.
sslkey Key file location. The file must contain PEM encoded data.
sslrootcert The location of the root certificate file. The file must contain PEM encoded data.
sslmode Whether or not to use SSL (disable|require|verify-ca|verify-full)

Redshift is PostgreSQL compatible but has some specific features (or lack thereof) that require slightly different behavior.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilConfig      = fmt.Errorf("no config")
	ErrNoDatabaseName = fmt.Errorf("no database name")
)
View Source
var DefaultMigrationsTable = "schema_migrations"

Functions

func WithInstance

func WithInstance(instance *sql.DB, config *Config) (database.Driver, error)

Types

type Config

type Config struct {
	MigrationsTable string
	DatabaseName    string
}

type Redshift

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

func (*Redshift) Close

func (p *Redshift) Close() error

func (*Redshift) Drop

func (p *Redshift) Drop() (err error)

func (*Redshift) Lock

func (p *Redshift) Lock() error

Redshift does not support advisory lock functions: https://docs.aws.amazon.com/redshift/latest/dg/c_unsupported-postgresql-functions.html

func (*Redshift) Open

func (p *Redshift) Open(url string) (database.Driver, error)

func (*Redshift) Run

func (p *Redshift) Run(migration io.Reader) error

func (*Redshift) SetVersion

func (p *Redshift) SetVersion(version int, dirty bool) error

func (*Redshift) Unlock

func (p *Redshift) Unlock() error

func (*Redshift) Version

func (p *Redshift) Version() (version int, dirty bool, err error)

Jump to

Keyboard shortcuts

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