postgreslegacy

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnsWithDataTypes

func ColumnsWithDataTypes(columns map[string]string, prefix string) string

func WithConfig

func WithConfig(h *Postgres, config *config.Config)

Types

type Credentials

type Credentials struct {
	Host       string
	DBName     string
	User       string
	Password   string
	Port       string
	SSLMode    string
	SSLDir     string
	TunnelInfo *tunnelling.TunnelInfo
	// contains filtered or unexported fields
}

type Postgres added in v1.8.0

type Postgres struct {
	DB             *sqlmiddleware.DB
	Namespace      string
	ObjectStorage  string
	Warehouse      model.Warehouse
	Uploader       warehouseutils.Uploader
	ConnectTimeout time.Duration

	SkipComputingUserLatestTraits               bool
	EnableSQLStatementExecutionPlan             bool
	TxnRollbackTimeout                          time.Duration
	EnableDeleteByJobs                          bool
	SkipComputingUserLatestTraitsWorkspaceIDs   []string
	EnableSQLStatementExecutionPlanWorkspaceIDs []string
	SlowQueryThreshold                          time.Duration
	// contains filtered or unexported fields
}

func New added in v1.8.0

func New() *Postgres

func (*Postgres) AddColumns added in v1.8.0

func (pg *Postgres) AddColumns(ctx context.Context, tableName string, columnsInfo []warehouseutils.ColumnInfo) (err error)

func (*Postgres) AlterColumn added in v1.8.0

func (*Postgres) Cleanup added in v1.8.0

func (pg *Postgres) Cleanup(ctx context.Context)

func (*Postgres) Connect added in v1.8.0

func (pg *Postgres) Connect(_ context.Context, warehouse model.Warehouse) (client.Client, error)

func (*Postgres) CrashRecover added in v1.8.0

func (pg *Postgres) CrashRecover(ctx context.Context)

func (*Postgres) CreateSchema added in v1.8.0

func (pg *Postgres) CreateSchema(ctx context.Context) (err error)

func (*Postgres) CreateTable added in v1.8.0

func (pg *Postgres) CreateTable(ctx context.Context, tableName string, columnMap model.TableSchema) (err error)

func (*Postgres) DeleteBy added in v1.8.0

func (pg *Postgres) DeleteBy(ctx context.Context, tableNames []string, params warehouseutils.DeleteByParams) (err error)

DeleteBy Need to create a structure with delete parameters instead of simply adding a long list of params

func (*Postgres) DownloadIdentityRules added in v1.8.0

func (*Postgres) DownloadIdentityRules(context.Context, *misc.GZipWriter) (err error)

func (*Postgres) DownloadLoadFiles added in v1.8.0

func (pg *Postgres) DownloadLoadFiles(ctx context.Context, tableName string) ([]string, error)

func (*Postgres) DropTable added in v1.8.0

func (pg *Postgres) DropTable(ctx context.Context, tableName string) (err error)

func (*Postgres) ErrorMappings added in v1.8.0

func (*Postgres) ErrorMappings() []model.JobError

func (*Postgres) FetchSchema added in v1.8.0

func (pg *Postgres) FetchSchema(ctx context.Context) (model.Schema, model.Schema, error)

FetchSchema queries postgres and returns the schema associated with provided namespace

func (*Postgres) GetTotalCountInTable added in v1.8.0

func (pg *Postgres) GetTotalCountInTable(ctx context.Context, tableName string) (int64, error)

func (*Postgres) IsEmpty added in v1.8.0

func (*Postgres) IsEmpty(context.Context, model.Warehouse) (empty bool, err error)

func (*Postgres) LoadIdentityMappingsTable added in v1.8.0

func (*Postgres) LoadIdentityMappingsTable(context.Context) (err error)

func (*Postgres) LoadIdentityMergeRulesTable added in v1.8.0

func (*Postgres) LoadIdentityMergeRulesTable(context.Context) (err error)

func (*Postgres) LoadTable added in v1.8.0

func (pg *Postgres) LoadTable(ctx context.Context, tableName string) error

func (*Postgres) LoadTestTable added in v1.8.0

func (pg *Postgres) LoadTestTable(ctx context.Context, _, tableName string, payloadMap map[string]interface{}, _ string) (err error)

func (*Postgres) LoadUserTables added in v1.8.0

func (pg *Postgres) LoadUserTables(ctx context.Context) map[string]error

func (*Postgres) SetConnectionTimeout added in v1.8.0

func (pg *Postgres) SetConnectionTimeout(timeout time.Duration)

func (*Postgres) Setup added in v1.8.0

func (pg *Postgres) Setup(_ context.Context, warehouse model.Warehouse, uploader warehouseutils.Uploader) (err error)

func (*Postgres) TestConnection added in v1.8.0

func (pg *Postgres) TestConnection(ctx context.Context, warehouse model.Warehouse) error

type QueryParams

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

Jump to

Keyboard shortcuts

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