Skip to content

PostgresProvisioner

Namespace: Ankus.PgConfig

Assembly: Ankus.PgConfig.dll

Installs selected PostgreSQL releases in an Ankus home without changing system installations or databases.

public sealed class PostgresProvisioner

Inheritance: object

Installs selected PostgreSQL releases in an Ankus home without changing system installations or databases.

public PostgresProvisioner(HttpClient client, string? homeDirectory = null)

Parameters:

client — HttpClient

The caller-owned client used for upstream HTTPS downloads.

homeDirectory — string

The Ankus home, defaulting to ANKUS_HOME or the current user’s ~/.ankus directory.

InstallAsync(IReadOnlyCollection<int>, PostgresProvisionOptions?, IProgress<string>?, CancellationToken)

Section titled “InstallAsync(IReadOnlyCollection<int>, PostgresProvisionOptions?, IProgress<string>?, CancellationToken)”

Downloads the latest releases, builds Unix sources or extracts Windows x64 binaries, and validates each installation. Existing completed installations with matching build options are reused. Registration is a separate atomic operation.

public Task<IReadOnlyList<PostgresInstallation>> InstallAsync(IReadOnlyCollection<int> majors, PostgresProvisionOptions? options = null, IProgress<string>? progress = null, CancellationToken cancellationToken = default)

Parameters:

majors — IReadOnlyCollection<int>

The PostgreSQL majors to install, from 13 through 19.

options — PostgresProvisionOptions

Source build options.

progress — IProgress<string>

Optional progress messages.

cancellationToken — CancellationToken

Cancels downloads or terminates the active native build and its children.

Returns: Task<IReadOnlyList<PostgresInstallation>>

Validated installations in ascending major order.