test

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const RegularConnString = "postgres://meroxauser:meroxapass@127.0.0.1:5433/meroxadb?sslmode=disable"

RegularConnString is a non-replication user connection string for the test postgres.

View Source
const RepmgrConnString = "postgres://repmgr:repmgrmeroxa@127.0.0.1:5433/meroxadb?sslmode=disable"

RepmgrConnString is a replication user connection string for the test postgres.

View Source
const TestTableAvroSchemaV1 = `` /* 715-byte string literal not displayed */

TestTableAvroSchemaV1 is the Avro schema representation of the test table defined through testTableCreateQuery. The fields are sorted by name.

View Source
const TestTableAvroSchemaV2 = `` /* 805-byte string literal not displayed */

TestTableAvroSchemaV2 is TestTableAvroSchemaV1 with `column6` (local-timestamp-micros) added.

View Source
const TestTableAvroSchemaV3 = `` /* 358-byte string literal not displayed */

TestTableAvroSchemaV3 is TestTableAvroSchemaV1 with `column4` and `column5` dropped.

View Source
const TestTableKeyAvroSchema = `{
    "type": "record",
    "name": "%s",
    "fields":
    [
        {"name":"id","type":"long"}
    ]
}`

TestTableKeyAvroSchema is the Avro schema for the test table's key column.

Variables

This section is empty.

Functions

func ConnectPool

func ConnectPool(ctx context.Context, t *testing.T, connString string) *pgxpool.Pool

func ConnectSimple

func ConnectSimple(ctx context.Context, t *testing.T, connString string) *pgx.Conn

func Context added in v0.10.0

func Context(t *testing.T) context.Context

func CreatePublication added in v0.7.1

func CreatePublication(t *testing.T, conn Querier, pubName string, tables []string)

func CreateReplicationSlot added in v0.7.1

func CreateReplicationSlot(t *testing.T, conn Querier, slotName string)

func IsPgError

func IsPgError(is *is.I, err error, wantCode string)

func RandomIdentifier

func RandomIdentifier(t *testing.T) string

func SetupTestTable

func SetupTestTable(ctx context.Context, t *testing.T, conn Querier) string

SetupTestTable creates a new table and returns its name.

Types

type Querier

type Querier interface {
	Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error)
	Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
}

Jump to

Keyboard shortcuts

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