package testing
import "github.com/vgarvardt/gue/v5/adapter/testing"
Index ¶
- Variables
- func OpenTestPoolLibPQ(t testing.TB) adapter.ConnPool
- func OpenTestPoolLibPQCustomSchemas(t testing.TB, gueSchema, secondSchema string) adapter.ConnPool
- func OpenTestPoolMaxConnsLibPQ(t testing.TB, maxConnections int, gueSchema, secondSchema string) adapter.ConnPool
- func OpenTestPoolMaxConnsPGXv4(t testing.TB, maxConnections int32) adapter.ConnPool
- func OpenTestPoolMaxConnsPGXv5(t testing.TB, maxConnections int32) adapter.ConnPool
- func OpenTestPoolPGXv4(t testing.TB) adapter.ConnPool
- func OpenTestPoolPGXv5(t testing.TB) adapter.ConnPool
- type CommandTag
- type Conn
- func (m *Conn) Begin(ctx context.Context) (adapter.Tx, error)
- func (m *Conn) Ping(ctx context.Context) error
- func (m *Conn) Release() error
- type ConnPool
- func (m *ConnPool) Acquire(ctx context.Context) (adapter.Conn, error)
- func (m *ConnPool) Begin(ctx context.Context) (adapter.Tx, error)
- func (m *ConnPool) Close() error
- func (m *ConnPool) Ping(ctx context.Context) error
- type OpenOpenTestPoolMaxConns
- type OpenTestPool
- type Queryable
- func (m *Queryable) Exec(ctx context.Context, query string, args ...any) (adapter.CommandTag, error)
- func (m *Queryable) Query(ctx context.Context, query string, args ...any) (adapter.Rows, error)
- func (m *Queryable) QueryRow(ctx context.Context, query string, args ...any) adapter.Row
- type Row
- type Rows
- type Tx
Variables ¶
var AllAdaptersOpenTestPool = map[string]OpenTestPool{ "pgx/v4": OpenTestPoolPGXv4, "pgx/v5": OpenTestPoolPGXv5, "lib/pq": OpenTestPoolLibPQ, }
AllAdaptersOpenTestPool lists all available adapters with callbacks
Functions ¶
func OpenTestPoolLibPQ ¶
OpenTestPoolLibPQ opens connections pool used in testing
func OpenTestPoolLibPQCustomSchemas ¶
OpenTestPoolLibPQCustomSchemas opens connections pool used in testing with gue table installed to own schema and search_path set to two different schemas
func OpenTestPoolMaxConnsLibPQ ¶
func OpenTestPoolMaxConnsLibPQ(t testing.TB, maxConnections int, gueSchema, secondSchema string) adapter.ConnPool
OpenTestPoolMaxConnsLibPQ opens connections pool used in testing
func OpenTestPoolMaxConnsPGXv4 ¶
OpenTestPoolMaxConnsPGXv4 opens connections pool used in testing
func OpenTestPoolMaxConnsPGXv5 ¶
OpenTestPoolMaxConnsPGXv5 opens connections pool used in testing
func OpenTestPoolPGXv4 ¶
OpenTestPoolPGXv4 opens connections pool used in testing
func OpenTestPoolPGXv5 ¶
OpenTestPoolPGXv5 opens connections pool used in testing
Types ¶
type CommandTag ¶
CommandTag mock implementation of adapter.CommandTag
func (*CommandTag) RowsAffected ¶
func (m *CommandTag) RowsAffected() int64
RowsAffected mock implementation of adapter.CommandTag.RowsAffected()
type Conn ¶
Conn mock implementation of adapter.Conn
func (*Conn) Begin ¶
Begin mock implementation of adapter.Conn.Begin()
func (*Conn) Ping ¶
Ping mock implementation of adapter.Conn.Ping()
func (*Conn) Release ¶
Release mock implementation of adapter.Conn.Release()
type ConnPool ¶
ConnPool mock implementation of adapter.ConnPool
func (*ConnPool) Acquire ¶
Acquire mock implementation of adapter.ConnPool.Acquire()
func (*ConnPool) Begin ¶
Begin mock implementation of adapter.ConnPool.Begin()
func (*ConnPool) Close ¶
Close mock implementation of adapter.ConnPool.Close()
func (*ConnPool) Ping ¶
Ping mock implementation of adapter.ConnPool.Ping()
type OpenOpenTestPoolMaxConns ¶
OpenOpenTestPoolMaxConns callback type for opening connection pool with custom max connections used in tests
type OpenTestPool ¶
OpenTestPool callback type for opening connection pool with default parameters used in tests
type Queryable ¶
Queryable mock implementation of adapter.Queryable
func (*Queryable) Exec ¶
func (m *Queryable) Exec(ctx context.Context, query string, args ...any) (adapter.CommandTag, error)
Exec mock implementation of adapter.Queryable.Exec()
func (*Queryable) Query ¶
Query mock implementation of adapter.Queryable.Query()
func (*Queryable) QueryRow ¶
QueryRow mock implementation of adapter.Queryable.QueryRow()
type Row ¶
Row mock implementation of adapter.Row
func (*Row) Scan ¶
Scan mock implementation of adapter.Row.Scan()
type Rows ¶
Rows mock implementation of adapter.Rows
func (*Rows) Err ¶
Err mock implementation of adapter.Rows.Err()
func (*Rows) Next ¶
Next mock implementation of adapter.Rows.Next()
func (*Rows) Scan ¶
Scan mock implementation of adapter.Rows.Scan()
type Tx ¶
Tx mock implementation of adapter.Tx
func (*Tx) Commit ¶
Commit mock implementation of adapter.Tx.Commit()
func (*Tx) Rollback ¶
Rollback mock implementation of adapter.Tx.Rollback()
Source Files ¶
all.go libpq.go mock.go pgxv4.go pgxv5.go
- Version
- v5.8.0 (latest)
- Published
- Mar 22, 2025
- Platform
- windows/amd64
- Imports
- 16 packages
- Last checked
- 4 hours ago –
Tools for package owners.