Documentation
¶
Index ¶
- Constants
- type MockPQDatabase
- type Option
- type Postgres
- func (p *Postgres) Close() error
- func (p *Postgres) GetEngineType() string
- func (p *Postgres) GetMaxDataPerWrite() int
- func (p *Postgres) GetMaxRetries() int
- func (p *Postgres) GetWatchBufferSize() int
- func (p *Postgres) IsReady(ctx context.Context) (bool, error)
- func (p *Postgres) Repair(ctx context.Context, config *RepairConfig) (*RepairResult, error)
- type RepairConfig
- type RepairResult
- type XID8
- func (x *XID8) AssignTo(dst interface{}) error
- func (x *XID8) DecodeBinary(ci *pgtype.ConnInfo, src []byte) error
- func (x *XID8) DecodeText(ci *pgtype.ConnInfo, src []byte) error
- func (x XID8) EncodeBinary(ci *pgtype.ConnInfo, buf []byte) ([]byte, error)
- func (x XID8) EncodeText(ci *pgtype.ConnInfo, buf []byte) ([]byte, error)
- func (x XID8) Get() interface{}
- func (x *XID8) Scan(src interface{}) error
- func (x *XID8) Set(src interface{}) error
- func (x XID8) Value() (driver.Value, error)
Constants ¶
const ( // ActiveRecordTxnID represents the maximum XID8 value used for active records // to avoid XID wraparound issues (instead of using 0) ActiveRecordTxnID = uint64(9223372036854775807) MaxXID8Value = "'9223372036854775807'::xid8" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockPQDatabase ¶ added in v0.3.8
MockPQDatabase simulates the behavior of a real PQDatabase.
func (*MockPQDatabase) Close ¶ added in v0.3.8
func (m *MockPQDatabase) Close() error
func (*MockPQDatabase) GetEngineType ¶ added in v0.3.8
func (m *MockPQDatabase) GetEngineType() string
type Option ¶
type Option func(*Postgres)
Option - Option type
func MaxConnectionIdleTime ¶ added in v0.2.3
MaxConnectionIdleTime - Defines maximum connection idle for postgresql db
func MaxConnectionLifeTime ¶ added in v0.2.3
MaxConnectionLifeTime - Defines maximum connection lifetime for postgresql db
func MaxDataPerWrite ¶ added in v0.7.9
func MaxIdleConnections ¶ added in v0.2.3
MaxIdleConnections - Defines maximum idle connections for postgresql db
func MaxOpenConnections ¶ added in v0.2.0
MaxOpenConnections - Defines maximum open connections for postgresql db
func MaxRetries ¶ added in v0.7.9
func WatchBufferSize ¶ added in v0.7.9
type Postgres ¶
type Postgres struct {
ReadPool *pgxpool.Pool
WritePool *pgxpool.Pool
Builder squirrel.StatementBuilderType
// contains filtered or unexported fields
}
Postgres - Structure for Postresql instance
func NewWithSeparateURIs ¶ added in v0.8.5
NewWithSeparateURIs -
func (*Postgres) GetEngineType ¶
GetEngineType - Get the engine type which is postgresql in string
func (*Postgres) GetMaxDataPerWrite ¶ added in v0.7.9
func (*Postgres) GetMaxRetries ¶ added in v0.7.9
func (*Postgres) GetWatchBufferSize ¶ added in v0.7.9
func (*Postgres) Repair ¶ added in v1.4.6
func (p *Postgres) Repair(ctx context.Context, config *RepairConfig) (*RepairResult, error)
Repair performs XID counter repair to prevent XID wraparound issues This function uses a safe approach: only advance XID counter, don't modify existing data
type RepairConfig ¶ added in v1.4.6
type RepairConfig struct {
BatchSize int // batch size for XID advancement
MaxRetries int // maximum number of retries
RetryDelay int // milliseconds
DryRun bool // perform a dry run without making changes
Verbose bool // enable verbose logging
}
RepairConfig holds configuration for the XID counter repair operation
func DefaultRepairConfig ¶ added in v1.4.6
func DefaultRepairConfig() *RepairConfig
DefaultRepairConfig returns default configuration for XID counter repair
type RepairResult ¶ added in v1.4.6
type RepairResult struct {
CreatedTxIdFixed int // Number of XIDs advanced in counter
Errors []error
Duration string
}
RepairResult holds the results of the XID counter repair operation
type XID8 ¶ added in v1.4.6
type XID8 pguint64
XID8 represents a PostgreSQL xid8 (64-bit transaction ID) type
func (*XID8) DecodeBinary ¶ added in v1.4.6
DecodeBinary decodes binary format
func (*XID8) DecodeText ¶ added in v1.4.6
DecodeText decodes text format
func (XID8) EncodeBinary ¶ added in v1.4.6
EncodeBinary encodes to binary format
func (XID8) EncodeText ¶ added in v1.4.6
EncodeText encodes to text format