mocks

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapper added in v0.5.0

type Mapper struct {
	TypeForOIDFn func(oid uint32) (string, error)
}

func (*Mapper) TypeForOID added in v0.5.0

func (m *Mapper) TypeForOID(oid uint32) (string, error)

type Querier

type Querier struct {
	QueryRowFn            func(ctx context.Context, dest []any, query string, args ...any) error
	QueryFn               func(ctx context.Context, i uint, query string, args ...any) (postgres.Rows, error)
	ExecFn                func(context.Context, uint, string, ...any) (postgres.CommandTag, error)
	ExecInTxFn            func(context.Context, func(tx postgres.Tx) error) error
	ExecInTxWithOptionsFn func(context.Context, uint, func(tx postgres.Tx) error, postgres.TxOptions) error
	CopyFromFn            func(ctx context.Context, tableName string, columnNames []string, srcRows [][]any) (int64, error)
	PingFn                func(context.Context) error
	CloseFn               func(context.Context) error
	// contains filtered or unexported fields
}

func (*Querier) Close

func (m *Querier) Close(ctx context.Context) error

func (*Querier) CopyFrom added in v0.6.0

func (m *Querier) CopyFrom(ctx context.Context, tableName string, columnNames []string, srcRows [][]any) (rowCount int64, err error)

func (*Querier) Exec

func (m *Querier) Exec(ctx context.Context, query string, args ...any) (postgres.CommandTag, error)

func (*Querier) ExecInTx added in v0.3.0

func (m *Querier) ExecInTx(ctx context.Context, fn func(tx postgres.Tx) error) error

func (*Querier) ExecInTxWithOptions added in v0.3.0

func (m *Querier) ExecInTxWithOptions(ctx context.Context, fn func(tx postgres.Tx) error, opts postgres.TxOptions) error

func (*Querier) Ping added in v0.5.0

func (m *Querier) Ping(ctx context.Context) error

func (*Querier) Query

func (m *Querier) Query(ctx context.Context, query string, args ...any) (postgres.Rows, error)

func (*Querier) QueryRow

func (m *Querier) QueryRow(ctx context.Context, dest []any, query string, args ...any) error

type ReplicationConn

type ReplicationConn struct {
	IdentifySystemFn          func(ctx context.Context) (postgres.IdentifySystemResult, error)
	StartReplicationFn        func(ctx context.Context, cfg postgres.ReplicationConfig) error
	SendStandbyStatusUpdateFn func(ctx context.Context, lsn uint64) error
	ReceiveMessageFn          func(ctx context.Context) (*postgres.ReplicationMessage, error)
	CloseFn                   func(ctx context.Context) error
}

func (*ReplicationConn) Close

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

func (*ReplicationConn) IdentifySystem

func (*ReplicationConn) ReceiveMessage

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

func (*ReplicationConn) SendStandbyStatusUpdate

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

func (*ReplicationConn) StartReplication

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

type Rows added in v0.3.0

type Rows struct {
	CloseFn             func()
	ErrFn               func() error
	FieldDescriptionsFn func() []pgconn.FieldDescription
	NextFn              func(i uint) bool
	ScanFn              func(i uint, dest ...any) error
	ValuesFn            func() ([]any, error)
	RawValuesFn         func() [][]byte
	// contains filtered or unexported fields
}

func (*Rows) Close added in v0.3.0

func (m *Rows) Close()

func (*Rows) CommandTag added in v0.3.0

func (m *Rows) CommandTag() pgconn.CommandTag

func (*Rows) Conn added in v0.3.0

func (m *Rows) Conn() *pgx.Conn

func (*Rows) Err added in v0.3.0

func (m *Rows) Err() error

func (*Rows) FieldDescriptions added in v0.3.0

func (m *Rows) FieldDescriptions() []pgconn.FieldDescription

func (*Rows) Next added in v0.3.0

func (m *Rows) Next() bool

func (*Rows) RawValues added in v0.3.0

func (m *Rows) RawValues() [][]byte

func (*Rows) Scan added in v0.3.0

func (m *Rows) Scan(dest ...any) error

func (*Rows) Values added in v0.3.0

func (m *Rows) Values() ([]any, error)

type Tx added in v0.3.0

type Tx struct {
	QueryRowFn       func(ctx context.Context, dest []any, query string, args ...any) error
	QueryFn          func(ctx context.Context, query string, args ...any) (postgres.Rows, error)
	ExecFn           func(ctx context.Context, i uint, query string, args ...any) (postgres.CommandTag, error)
	CopyFromFn       func(ctx context.Context, tableName string, columnNames []string, srcRows [][]any) (int64, error)
	CopyFromTextFn   func(ctx context.Context, tableName string, columnNames []string, srcRows [][]any) (int64, error)
	CopyToWriterFn   func(ctx context.Context, w io.Writer, sql string) (int64, error)
	CopyFromReaderFn func(ctx context.Context, r io.Reader, sql string) (int64, error)
	// contains filtered or unexported fields
}

func (*Tx) CopyFrom added in v0.6.2

func (m *Tx) CopyFrom(ctx context.Context, tableName string, columnNames []string, srcRows [][]any) (rowCount int64, err error)

func (*Tx) CopyFromReader added in v1.4.2

func (m *Tx) CopyFromReader(ctx context.Context, r io.Reader, sql string) (rowCount int64, err error)

func (*Tx) CopyFromText added in v1.1.0

func (m *Tx) CopyFromText(ctx context.Context, tableName string, columnNames []string, srcRows [][]any) (rowCount int64, err error)

func (*Tx) CopyToWriter added in v1.4.2

func (m *Tx) CopyToWriter(ctx context.Context, w io.Writer, sql string) (rowCount int64, err error)

func (*Tx) Exec added in v0.3.0

func (m *Tx) Exec(ctx context.Context, query string, args ...any) (postgres.CommandTag, error)

func (*Tx) Query added in v0.3.0

func (m *Tx) Query(ctx context.Context, query string, args ...any) (postgres.Rows, error)

func (*Tx) QueryRow added in v0.3.0

func (m *Tx) QueryRow(ctx context.Context, dest []any, query string, args ...any) error

Jump to

Keyboard shortcuts

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