Documentation ¶
Index ¶
- func ColumnsWithDataTypes(columns model.TableSchema, prefix string) string
- func Connect(cred Credentials) (*sql.DB, error)
- func Init()
- func WithConfig(h *Postgres, config *config.Config)
- type Credentials
- type Diagnostic
- type LoadTable
- type LoadUsersTable
- type Postgres
- func (pg *Postgres) AddColumns(tableName string, columnsInfo []warehouseutils.ColumnInfo) (err error)
- func (*Postgres) AlterColumn(_, _, _ string) (model.AlterTableResponse, error)
- func (pg *Postgres) Cleanup()
- func (pg *Postgres) Connect(warehouse model.Warehouse) (client.Client, error)
- func (pg *Postgres) CrashRecover(model.Warehouse) error
- func (pg *Postgres) CreateSchema() (err error)
- func (pg *Postgres) CreateTable(tableName string, columnMap model.TableSchema) (err error)
- func (pg *Postgres) DeleteBy(tableNames []string, params warehouseutils.DeleteByParams) (err error)
- func (*Postgres) DownloadIdentityRules(*misc.GZipWriter) (err error)
- func (pg *Postgres) DropTable(tableName string) (err error)
- func (pg *Postgres) ErrorMappings() []model.JobError
- func (pg *Postgres) FetchSchema(warehouse model.Warehouse) (schema, unrecognizedSchema model.Schema, err error)
- func (pg *Postgres) GetTotalCountInTable(ctx context.Context, tableName string) (int64, error)
- func (*Postgres) IsEmpty(_ model.Warehouse) (empty bool, err error)
- func (*Postgres) LoadIdentityMappingsTable() (err error)
- func (*Postgres) LoadIdentityMergeRulesTable() (err error)
- func (pg *Postgres) LoadTable(tableName string) error
- func (pg *Postgres) LoadTestTable(_, tableName string, payloadMap map[string]interface{}, _ string) (err error)
- func (pg *Postgres) LoadUserTables() map[string]error
- func (pg *Postgres) SetConnectionTimeout(timeout time.Duration)
- func (pg *Postgres) Setup(warehouse model.Warehouse, uploader warehouseutils.Uploader) (err error)
- func (pg *Postgres) TestConnection(warehouse model.Warehouse) (err error)
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColumnsWithDataTypes ¶
func ColumnsWithDataTypes(columns model.TableSchema, prefix string) string
func WithConfig ¶
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 Diagnostic ¶ added in v1.7.0
type Diagnostic struct { Logger logger.Logger Namespace string Warehouse *model.Warehouse Stats stats.Stats Config *config.Config }
func (*Diagnostic) TxnExecute ¶ added in v1.7.0
TxnExecute Print execution plan if enableWithQueryPlan is set to true else return result set. Currently, these statements are supported by EXPLAIN Any INSERT, UPDATE, DELETE whose execution plan you wish to see.
func (*Diagnostic) TxnRollback ¶ added in v1.7.0
func (d *Diagnostic) TxnRollback(txn Tx, tableName, stage string)
TxnRollback rolls back a transaction and logs the error.
type LoadTable ¶ added in v1.7.0
type LoadUsersTable ¶ added in v1.7.0
type LoadUsersTable struct { Logger logger.Logger DB *sql.DB Namespace string Warehouse *model.Warehouse Stats stats.Stats Config *config.Config LoadFileDownloader downloader.Downloader }
func (*LoadUsersTable) Load ¶ added in v1.7.0
func (lut *LoadUsersTable) Load(ctx context.Context, identifiesSchemaInUpload, usersSchemaInUpload, usersSchemaInWarehouse model.TableSchema) map[string]error
type Postgres ¶ added in v1.7.0
type Postgres struct { DB *sql.DB Namespace string ObjectStorage string Warehouse model.Warehouse Uploader warehouseutils.Uploader ConnectTimeout time.Duration Logger logger.Logger EnableDeleteByJobs bool NumWorkersDownloadLoadFiles int LoadFileDownloader downloader.Downloader }
func NewPostgres ¶ added in v1.7.0
func NewPostgres() *Postgres
func (*Postgres) AddColumns ¶ added in v1.7.0
func (pg *Postgres) AddColumns(tableName string, columnsInfo []warehouseutils.ColumnInfo) (err error)
func (*Postgres) AlterColumn ¶ added in v1.7.0
func (*Postgres) AlterColumn(_, _, _ string) (model.AlterTableResponse, error)
func (*Postgres) CrashRecover ¶ added in v1.7.0
func (*Postgres) CreateSchema ¶ added in v1.7.0
func (*Postgres) CreateTable ¶ added in v1.7.0
func (pg *Postgres) CreateTable(tableName string, columnMap model.TableSchema) (err error)
func (*Postgres) DeleteBy ¶ added in v1.7.0
func (pg *Postgres) 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 (*Postgres) DownloadIdentityRules ¶ added in v1.7.0
func (*Postgres) DownloadIdentityRules(*misc.GZipWriter) (err error)
func (*Postgres) ErrorMappings ¶ added in v1.7.0
func (*Postgres) FetchSchema ¶ added in v1.7.0
func (pg *Postgres) FetchSchema(warehouse model.Warehouse) (schema, unrecognizedSchema model.Schema, err error)
FetchSchema queries postgres and returns the schema associated with provided namespace
func (*Postgres) GetTotalCountInTable ¶ added in v1.7.0
func (*Postgres) LoadIdentityMappingsTable ¶ added in v1.7.0
func (*Postgres) LoadIdentityMergeRulesTable ¶ added in v1.7.0
func (*Postgres) LoadTestTable ¶ added in v1.7.0
func (*Postgres) LoadUserTables ¶ added in v1.7.0
func (*Postgres) SetConnectionTimeout ¶ added in v1.7.0
Click to show internal directories.
Click to hide internal directories.