postgres

package
v1.5.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: AGPL-3.0 Imports: 21 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 Connect

func Connect(cred CredentialsT) (*sql.DB, error)

func Init

func Init()

func WithConfig added in v1.5.0

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

Types

type CredentialsT

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

type Handle added in v1.5.0

type Handle struct {
	DB             *sql.DB
	Namespace      string
	ObjectStorage  string
	Warehouse      warehouseutils.Warehouse
	Uploader       warehouseutils.UploaderI
	ConnectTimeout time.Duration

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

func NewHandle added in v1.5.0

func NewHandle() *Handle

func (*Handle) AddColumns added in v1.5.0

func (pg *Handle) AddColumns(tableName string, columnsInfo []warehouseutils.ColumnInfo) (err error)

func (*Handle) AlterColumn added in v1.5.0

func (*Handle) AlterColumn(_, _, _ string) (err error)

func (*Handle) Cleanup added in v1.5.0

func (pg *Handle) Cleanup()

func (*Handle) Connect added in v1.5.0

func (pg *Handle) Connect(warehouse warehouseutils.Warehouse) (client.Client, error)

func (*Handle) CrashRecover added in v1.5.0

func (pg *Handle) CrashRecover(warehouse warehouseutils.Warehouse) (err error)

func (*Handle) CreateSchema added in v1.5.0

func (pg *Handle) CreateSchema() (err error)

func (*Handle) CreateTable added in v1.5.0

func (pg *Handle) CreateTable(tableName string, columnMap map[string]string) (err error)

func (*Handle) DeleteBy added in v1.5.0

func (pg *Handle) DeleteBy(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 (*Handle) DownloadIdentityRules added in v1.5.0

func (*Handle) DownloadIdentityRules(*misc.GZipWriter) (err error)

func (*Handle) DownloadLoadFiles added in v1.5.0

func (pg *Handle) DownloadLoadFiles(tableName string) ([]string, error)

func (*Handle) DropTable added in v1.5.0

func (pg *Handle) DropTable(tableName string) (err error)

func (*Handle) FetchSchema added in v1.5.0

func (pg *Handle) FetchSchema(warehouse warehouseutils.Warehouse) (schema, unrecognizedSchema warehouseutils.SchemaT, err error)

FetchSchema queries postgres and returns the schema associated with provided namespace

func (*Handle) GetTotalCountInTable added in v1.5.0

func (pg *Handle) GetTotalCountInTable(ctx context.Context, tableName string) (total int64, err error)

func (*Handle) IsEmpty added in v1.5.0

func (*Handle) IsEmpty(_ warehouseutils.Warehouse) (empty bool, err error)

func (*Handle) LoadIdentityMappingsTable added in v1.5.0

func (*Handle) LoadIdentityMappingsTable() (err error)

func (*Handle) LoadIdentityMergeRulesTable added in v1.5.0

func (*Handle) LoadIdentityMergeRulesTable() (err error)

func (*Handle) LoadTable added in v1.5.0

func (pg *Handle) LoadTable(tableName string) error

func (*Handle) LoadTestTable added in v1.5.0

func (pg *Handle) LoadTestTable(_, tableName string, payloadMap map[string]interface{}, _ string) (err error)

func (*Handle) LoadUserTables added in v1.5.0

func (pg *Handle) LoadUserTables() map[string]error

func (*Handle) SetConnectionTimeout added in v1.5.0

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

func (*Handle) Setup added in v1.5.0

func (pg *Handle) Setup(
	warehouse warehouseutils.Warehouse,
	uploader warehouseutils.UploaderI,
) (err error)

func (*Handle) TestConnection added in v1.5.0

func (pg *Handle) TestConnection(warehouse warehouseutils.Warehouse) (err error)

type QueryParams added in v0.2.0

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