postgres

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorSessionClosed      = errors.New(types.ErrorSessionClosed)
	ErrorEmptyRow           = errors.New(types.ErrorEmptyRow)
	ErrorEmptyTableName     = errors.New(types.ErrorEmptyTableName)
	ErrorMultipleDBM        = errors.New(types.ErrorMultipleDBM)
	ErrorNilObject          = errors.New(types.ErrorNilObject)
	ErrorCollectionNotFound = errors.New(types.ErrorCollectionNotFound)
	ErrorIndexEmpty         = errors.New(types.ErrorIndexEmpty)
	ErrorNilContext         = errors.New(types.ErrorNilContext)
	ErrorIndexAlreadyExist  = errors.New(types.ErrorIndexAlreadyExist)
	ErrorIndexComposedTTL   = errors.New(types.ErrorIndexComposedTTL)
	ErrorRowOptDiffLength   = errors.New(types.ErrorRowOptDiffLenght)
	ErrorEmptyConnStr       = errors.New("empty connection string")
)

Functions

func NewPostgresDriver

func NewPostgresDriver(opts *types.ClientOpts) (*driver, error)

NewPostgresDriver initializes a new PostgreSQL driver with the given client options. Returns the driver instance or an error if the connection setup fails.

Types

type BasicInfo

type BasicInfo struct {
	DBName         string
	DBUser         string
	Version        string
	ServerVersion  string
	DBSizeBytes    int64
	StartTime      time.Time
	MaxConnections string
}

type BasicStats

type BasicStats struct {
	RowCount          int64
	DeadRowCount      int64
	ModifiedCount     int64
	LastVacuum        sql.NullTime
	LastAutovacuum    sql.NullTime
	LastAnalyze       sql.NullTime
	LastAutoanalyze   sql.NullTime
	VacuumCount       int64
	AutovacuumCount   int64
	AnalyzeCount      int64
	AutoanalyzeCount  int64
	EstimatedRowCount float64
	PageCount         float64
	SizeBytes         int64
	TotalSizeBytes    int64
}

type ColumnStats

type ColumnStats struct {
	ColumnName       string
	DataType         string
	NullFraction     float64
	AverageWidth     float64
	DistinctValues   float64
	MostCommonValues sql.NullString
	MostCommonFreqs  sql.NullString
	HistogramBounds  sql.NullString
	Correlation      sql.NullString
}

ColumnStats Define a struct to hold the column statistics

type IndexRow

type IndexRow struct {
	IndexName  string
	ColumnName string
	IsUnique   bool
	IndexType  string
	Direction  int
	Comment    *string // Using pointer for nullable string
}

type IndexStats

type IndexStats struct {
	IndexName      string
	ScanCount      int64
	TuplesRead     int64
	TuplesFetched  int64
	IndexSizeBytes int64
}

IndexStats Define a struct to hold the index statistics

Jump to

Keyboard shortcuts

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