engines

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package engines defines the DatabaseEngine interface implemented by every supported database backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckResult

type CheckResult struct {
	Name     string
	Status   string // PASS, FAIL, NOT_RUN, SKIPPED
	Expected string
	Actual   string
	Err      error
}

CheckResult is the outcome of a single validation check.

type DatabaseEngine

type DatabaseEngine interface {
	// Name returns the engine identifier (e.g. "postgres").
	Name() string

	// RequiredCapabilities returns the Linux capabilities the
	// engine needs inside its container.
	RequiredCapabilities() []string

	// WaitUntilReady blocks until the database accepts connections
	// or the context is cancelled.
	WaitUntilReady(ctx context.Context, c *sandbox.Container, username, database string) error

	// Restore loads the artifact into the target database using the
	// options specified in the contract.
	Restore(ctx context.Context, c *sandbox.Container, artifactPath string, opts contract.Test) error

	// RunCheck executes a single validation check.
	RunCheck(ctx context.Context, c *sandbox.Container, chk contract.Check, opts contract.Test) (CheckResult, error)
}

DatabaseEngine is implemented by every supported database backend.

Directories

Path Synopsis
Package postgres implements the engines.DatabaseEngine interface for PostgreSQL.
Package postgres implements the engines.DatabaseEngine interface for PostgreSQL.

Jump to

Keyboard shortcuts

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