harness

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = 5432
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DoltgresHarness added in v0.4.0

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

DoltgresHarness is a sqllogictest harness for doltgres databases.

func NewDoltgresHarness added in v0.4.0

func NewDoltgresHarness(doltgresExec string, t int64) *DoltgresHarness

NewDoltgresHarness returns a harness that manages its own server lifecycle. The server is started once at construction; Init resets the database without restarting the process.

func NewDoltgresWorkerHarness added in v0.56.8

func NewDoltgresWorkerHarness(port int, dbName string, t int64) *DoltgresHarness

NewDoltgresWorkerHarness returns a harness for use in a concurrent worker. It connects to an already-running server on the given port using dbName as its isolated database. The caller is responsible for starting and stopping the server (see StartSharedServer).

func (*DoltgresHarness) Close added in v0.4.0

func (h *DoltgresHarness) Close() error

func (*DoltgresHarness) EngineStr added in v0.4.0

func (h *DoltgresHarness) EngineStr() string

func (*DoltgresHarness) ExecuteQuery added in v0.4.0

func (h *DoltgresHarness) ExecuteQuery(statement string) (schema string, results []string, err error)

func (*DoltgresHarness) ExecuteQueryContext added in v0.10.0

func (h *DoltgresHarness) ExecuteQueryContext(ctx context.Context, statement string) (schema string, results []string, err error)

func (*DoltgresHarness) ExecuteStatement added in v0.4.0

func (h *DoltgresHarness) ExecuteStatement(statement string) error

func (*DoltgresHarness) ExecuteStatementContext added in v0.10.0

func (h *DoltgresHarness) ExecuteStatementContext(ctx context.Context, statement string) error

func (*DoltgresHarness) GetTimeout added in v0.4.0

func (h *DoltgresHarness) GetTimeout() int64

func (*DoltgresHarness) Init added in v0.4.0

func (h *DoltgresHarness) Init() error

Init resets the harness to a clean state for the next test file. For worker harnesses (no server process), it keeps a persistent connection and resets the public schema via DROP+CREATE — avoiding database-level connection races entirely. For server-owning harnesses, it drops and recreates the database (safe because only one worker uses each database in the non-concurrent path).

type DoltgresServer added in v0.4.0

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

func StartSharedServer added in v0.56.8

func StartSharedServer(doltgresExec string) *DoltgresServer

StartSharedServer starts a single doltgres server process for use by multiple concurrent workers. The returned *DoltgresServer must be closed when testing is complete.

func (*DoltgresServer) Close added in v0.4.0

func (s *DoltgresServer) Close()

func (*DoltgresServer) Start added in v0.4.0

func (s *DoltgresServer) Start()

func (*DoltgresServer) Stop added in v0.4.0

func (s *DoltgresServer) Stop()

type PostgresqlServerHarness

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

sqllogictest harness for postgres databases.

func NewPostgresqlHarness

func NewPostgresqlHarness(dsn string, t int64) *PostgresqlServerHarness

NewPostgresqlHarness returns a new Postgres test harness for the data source name given. Panics if it cannot open a connection using the DSN.

func (*PostgresqlServerHarness) EngineStr

func (h *PostgresqlServerHarness) EngineStr() string

func (*PostgresqlServerHarness) ExecuteQuery

func (h *PostgresqlServerHarness) ExecuteQuery(statement string) (schema string, results []string, err error)

See Harness.ExecuteQuery

func (*PostgresqlServerHarness) ExecuteQueryContext added in v0.10.0

func (h *PostgresqlServerHarness) ExecuteQueryContext(ctx context.Context, statement string) (schema string, results []string, err error)

func (*PostgresqlServerHarness) ExecuteStatement

func (h *PostgresqlServerHarness) ExecuteStatement(statement string) error

See Harness.ExecuteStatement

func (*PostgresqlServerHarness) ExecuteStatementContext added in v0.10.0

func (h *PostgresqlServerHarness) ExecuteStatementContext(ctx context.Context, statement string) error

func (*PostgresqlServerHarness) GetTimeout added in v0.4.0

func (h *PostgresqlServerHarness) GetTimeout() int64

func (*PostgresqlServerHarness) Init

func (h *PostgresqlServerHarness) Init() error

Jump to

Keyboard shortcuts

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