Skip to content
Alvo is pre-v0.1: the image runs from its edge tag, and no NuGet package or release is published yet.Pre-v0.1: no release yet.Roadmap and status

MMLib.Alvo.Data.PostgreSql

The PostgreSQL driver for Alvo, registered with UsePostgreSql.

The PostgreSQL driver for Alvo, registered with UsePostgreSql.

class

Configuration for the PostgreSQL database provider, resolved from DI as IOptions<PostgreSqlProviderOptions> when the provider is built. Every UsePostgreSql overload funnels into this object, so a host can pass the connection string inline or bind it from configuration.

public string? ConnectionString { get; set; }

Gets or sets the PostgreSQL ADO.NET connection string. A connection string must end up set by the time the provider is built (inline, or via a configure delegate that binds it from configuration); otherwise provider construction fails fast with a clear error.

Namespace Microsoft.Extensions.DependencyInjection

Section titled “Namespace Microsoft.Extensions.DependencyInjection”

static class

Registers PostgreSQL as Alvo’s database provider on an IAlvoBuilder.

public const string DefaultConnectionName = "Alvo";

The default ConnectionStrings entry name the configuration overloads resolve.

public static IAlvoBuilder UsePostgreSql(this IAlvoBuilder builder)

Registers PostgreSQL as Alvo’s database provider, resolving the connection string from the application’s IConfiguration when the provider is built — the standard ConnectionStrings:Alvo entry (see GetConnectionString). Use this parameterless overload when the connection string lives in configuration (appsettings.json, environment variables, …) under the default DefaultConnectionName name; the resolution is deferred, so the host’s IConfiguration only has to be registered by the time the provider is built.

  • builder — The Alvo builder.

Returns: The same builder, for chaining.

public static IAlvoBuilder UsePostgreSql(this IAlvoBuilder builder, Action<PostgreSqlProviderOptions> configure)

Registers PostgreSQL as Alvo’s database provider, configured entirely through PostgreSqlProviderOptions (set the connection string inside configure, e.g. by binding it from configuration). Today this wires the schema-registry and migration services to PostgreSQL; further Alvo data services attach here as the framework grows.

  • builder — The Alvo builder.
  • configure — Configures the PostgreSQL provider options.

Returns: The same builder, for chaining.

public static IAlvoBuilder UsePostgreSql(this IAlvoBuilder builder, IConfiguration configuration, string connectionName = "Alvo")

Registers PostgreSQL as Alvo’s database provider, resolving the connection string by name from the given IConfiguration — the standard ConnectionStrings:{connectionName} entry. Use this when the connection string lives under a non-default name.

  • builder — The Alvo builder.
  • configuration — The configuration to read the connection string from.
  • connectionName — The ConnectionStrings entry name (default DefaultConnectionName).

Returns: The same builder, for chaining.

public static IAlvoBuilder UsePostgreSql(this IAlvoBuilder builder, string connectionString)

Registers PostgreSQL as Alvo’s database provider using the given connection string. Today this wires the schema-registry and migration services (ISchemaMigrator, ISchemaIntrospector, IAppliedSchemaStore) to PostgreSQL; further Alvo data services attach here as the framework grows.

  • builder — The Alvo builder.
  • connectionString — The PostgreSQL ADO.NET connection string (e.g. from config.GetConnectionString("Alvo")).

Returns: The same builder, for chaining.

public static IAlvoBuilder UsePostgreSql(this IAlvoBuilder builder, string connectionString, Action<PostgreSqlProviderOptions> configure)

Registers PostgreSQL as Alvo’s database provider using the given connection string, then applies configure for additional tuning. Today this wires the schema-registry and migration services to PostgreSQL; further Alvo data services attach here as the framework grows.

  • builder — The Alvo builder.
  • connectionString — The PostgreSQL ADO.NET connection string.
  • configure — Configures additional PostgreSQL provider options; runs after the connection string is set.

Returns: The same builder, for chaining.