Skip to content

PgTestAttribute

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Declares a synchronous, zero-SQL-argument test that runs inside PostgreSQL. Native entry points are emitted only when AnkusIncludeTests is enabled.

[AttributeUsage(AttributeTargets.Method)]
public sealed class PgTestAttribute : Attribute

Inheritance: object, Attribute

public PgTestAttribute()

Gets or sets the positive finite planner cost of the test function. The default is one.

public double Cost { get; set; }

Value: double

Gets or sets the exact PostgreSQL primary error message expected from the test, or null for success.

public string? ExpectedError { get; set; }

Value: string

Gets or sets a reason for the host test framework to report this test as ignored.

public string? IgnoreReason { get; set; }

Value: string

Gets or sets whether PostgreSQL may run the test function in parallel queries. The default is Unsafe.

public PgParallelSafety ParallelSafety { get; set; }

Value: PgParallelSafety

Gets or sets an ordered schema search path scoped to this test; null preserves the caller’s path. Use ExtensionSchema for the schema selected during CREATE EXTENSION.

public string[]? SearchPath { get; set; }

Value: string[]

Gets or sets whether the test function runs with its owner’s privileges instead of the caller’s.

public bool SecurityDefiner { get; set; }

Value: bool

Gets or sets the test function’s volatility, as pgrx’s #[pg_test] passes #[pg_extern] options through. The default is Volatile.

public PgVolatility Volatility { get; set; }

Value: PgVolatility