postgres

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresScapperConf

type PostgresScapperConf struct {
	dwhexecpostgres.PostgresConf
}

type PostgresScrapper

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

func NewPostgresScrapper

func NewPostgresScrapper(ctx context.Context, conf *PostgresScapperConf) (*PostgresScrapper, error)

func (*PostgresScrapper) Capabilities added in v0.10.6

func (e *PostgresScrapper) Capabilities() scrapper.Capabilities

func (*PostgresScrapper) Close

func (e *PostgresScrapper) Close() error

func (*PostgresScrapper) DialectType added in v0.1.8

func (e *PostgresScrapper) DialectType() string

func (*PostgresScrapper) EstimateQuery added in v0.16.0

func (e *PostgresScrapper) EstimateQuery(ctx context.Context, sql string) (*scrapper.QueryEstimate, error)

EstimateQuery returns a row estimate via `EXPLAIN (FORMAT JSON)`, which plans the query without executing it (no ANALYZE). Postgres reports a planner row estimate but no scan-bytes figure, so only Rows is populated. The estimate is only as good as the table's last ANALYZE and can be off by orders of magnitude on stale statistics.

Rows is the largest per-node "Plan Rows" across the whole plan tree, not the top node's output. The top node emits post-aggregation cardinality — 1 for `SELECT count(*) FROM big_table` — which is useless as a scan-size warning; the deepest scan node carries the figure a caller actually wants to warn on.

func (*PostgresScrapper) Executor added in v0.12.0

func (*PostgresScrapper) IsPermissionError added in v0.1.1

func (e *PostgresScrapper) IsPermissionError(err error) bool

func (*PostgresScrapper) QueryCatalog

func (e *PostgresScrapper) QueryCatalog(ctx context.Context) ([]*scrapper.CatalogColumnRow, error)

func (*PostgresScrapper) QueryCustomMetrics

func (e *PostgresScrapper) QueryCustomMetrics(ctx context.Context, sql string, args ...any) ([]*scrapper.CustomMetricsRow, error)

func (*PostgresScrapper) QueryDatabases

func (e *PostgresScrapper) QueryDatabases(ctx context.Context) ([]*scrapper.DatabaseRow, error)

func (*PostgresScrapper) QueryPlatformUsers added in v0.21.0

func (e *PostgresScrapper) QueryPlatformUsers(ctx context.Context) (*scrapper.PlatformUsers, error)

QueryPlatformUsers lists the roles that can log in. Every role can read pg_roles, so the listing is complete. Nothing a grant or the server version decides fails the call: a listing that could not be read is returned in its refused, unavailable or failed state, and a fact that could not be read is skipped with the reason.

func (*PostgresScrapper) QuerySchemas added in v0.14.5

func (e *PostgresScrapper) QuerySchemas(ctx context.Context) ([]*scrapper.SchemaRow, error)

func (*PostgresScrapper) QuerySegments

func (e *PostgresScrapper) QuerySegments(ctx context.Context, sql string, args ...any) ([]*scrapper.SegmentRow, error)

func (*PostgresScrapper) QueryShape added in v0.8.3

func (e *PostgresScrapper) QueryShape(ctx context.Context, sql string) ([]*scrapper.QueryShapeColumn, error)

func (*PostgresScrapper) QuerySqlDefinitions

func (e *PostgresScrapper) QuerySqlDefinitions(ctx context.Context) ([]*scrapper.SqlDefinitionRow, error)

func (*PostgresScrapper) QueryTableConstraints added in v0.9.0

func (e *PostgresScrapper) QueryTableConstraints(ctx context.Context) ([]*scrapper.TableConstraintRow, error)

func (*PostgresScrapper) QueryTableMetrics

func (e *PostgresScrapper) QueryTableMetrics(ctx context.Context, lastMetricsFetchTime time.Time) ([]*scrapper.TableMetricsRow, error)

func (*PostgresScrapper) QueryTables

func (e *PostgresScrapper) QueryTables(ctx context.Context, opts ...scrapper.QueryTablesOption) ([]*scrapper.TableRow, error)

func (*PostgresScrapper) RunRawQuery added in v0.13.7

func (*PostgresScrapper) SqlDialect added in v0.1.8

func (e *PostgresScrapper) SqlDialect() sqldialect.Dialect

func (*PostgresScrapper) ValidateConfiguration

func (e *PostgresScrapper) ValidateConfiguration(ctx context.Context) ([]string, error)

Jump to

Keyboard shortcuts

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