postgres

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnTimeout = errors.New("connection timeout")
View Source
var ErrUnsupportedCopyDataMessage = errors.New("unsupported copy data message")

Functions

This section is empty.

Types

type CommandTag

type CommandTag struct {
	pgconn.CommandTag
}

type Conn

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

func NewConn

func NewConn(ctx context.Context, url string) (*Conn, error)

func (*Conn) Close

func (c *Conn) Close(ctx context.Context) error

func (*Conn) Exec

func (c *Conn) Exec(ctx context.Context, query string, args ...any) (CommandTag, error)

func (*Conn) Query

func (c *Conn) Query(ctx context.Context, query string, args ...any) (Rows, error)

func (*Conn) QueryRow

func (c *Conn) QueryRow(ctx context.Context, query string, args ...any) Row

type Error

type Error struct {
	Severity string
	Msg      string
}

func (*Error) Error

func (e *Error) Error() string

type IdentifySystemResult

type IdentifySystemResult pglogrepl.IdentifySystemResult

type Pool

type Pool struct {
	*pgxpool.Pool
}

func NewConnPool

func NewConnPool(ctx context.Context, url string) (*Pool, error)

func (*Pool) Close

func (c *Pool) Close(_ context.Context) error

func (*Pool) Exec

func (c *Pool) Exec(ctx context.Context, query string, args ...any) (CommandTag, error)

func (*Pool) Query

func (c *Pool) Query(ctx context.Context, query string, args ...any) (Rows, error)

func (*Pool) QueryRow

func (c *Pool) QueryRow(ctx context.Context, query string, args ...any) Row

type Querier

type Querier interface {
	Query(ctx context.Context, query string, args ...any) (Rows, error)
	QueryRow(ctx context.Context, query string, args ...any) Row
	Exec(ctx context.Context, query string, args ...any) (CommandTag, error)
	Close(ctx context.Context) error
}

type ReplicationConfig

type ReplicationConfig struct {
	SlotName        string
	StartPos        uint64
	PluginArguments []string
}

type ReplicationConn

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

func NewReplicationConn

func NewReplicationConn(ctx context.Context, url string) (*ReplicationConn, error)

func (*ReplicationConn) Close

func (c *ReplicationConn) Close(ctx context.Context) error

func (*ReplicationConn) IdentifySystem

func (c *ReplicationConn) IdentifySystem(ctx context.Context) (IdentifySystemResult, error)

func (*ReplicationConn) ReceiveMessage

func (c *ReplicationConn) ReceiveMessage(ctx context.Context) (*ReplicationMessage, error)

func (*ReplicationConn) SendStandbyStatusUpdate

func (c *ReplicationConn) SendStandbyStatusUpdate(ctx context.Context, lsn uint64) error

func (*ReplicationConn) StartReplication

func (c *ReplicationConn) StartReplication(ctx context.Context, cfg ReplicationConfig) error

type ReplicationMessage

type ReplicationMessage struct {
	LSN            uint64
	ServerTime     time.Time
	WALData        []byte
	ReplyRequested bool
}

type Row

type Row interface {
	pgx.Row
}

type Rows

type Rows interface {
	pgx.Rows
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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