Documentation ¶
Index ¶
- func ExpectQuery(sql string, params [][]byte, oids []uint32) pgmock.Step
- func ExpectTerminate() pgmock.Step
- type MockConn
- func (r *MockConn) Close(t *testing.T)
- func (r *MockConn) Intercept(config *pgx.ConnConfig)
- func (r *MockConn) MockClient(t *testing.T, opts ...func(*pgx.ConnConfig)) *pgx.Conn
- func (r *MockConn) Query(sql string, args ...interface{}) *MockConn
- func (r *MockConn) Reply(tag string, rows ...interface{}) *MockConn
- func (r *MockConn) ReplyError(code, message string) *MockConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpectQuery ¶
Expects a SQL query in any form: simple, prepared, or anonymous.
func ExpectTerminate ¶
Types ¶
type MockConn ¶
type MockConn struct {
// contains filtered or unexported fields
}
func NewWithStatus ¶
func (*MockConn) Intercept ¶
func (r *MockConn) Intercept(config *pgx.ConnConfig)
Configures pgx to use the mock dialer.
The mock dialer provides a full duplex net.Conn backed by an in-memory buffer. It is implemented by grcp/test/bufconn package.
func (*MockConn) MockClient ¶
func (*MockConn) Reply ¶
Adds a server reply using binary or text protocol format.
TODO: support prepared statements when using binary protocol
func (*MockConn) ReplyError ¶
Simulates an error reply from the server.
TODO: simulate a notice reply
Click to show internal directories.
Click to hide internal directories.