10 instantiations of PostgresServerResource
Aspire.Hosting.Azure.Tests (1)
PublicApiTests\PostgreSQLPublicApiTests.cs (1)
140var innerResource = new PostgresServerResource("postgre", userName, resource);
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
62var postgresServer = new PostgresServerResource(name, userName?.Resource, passwordParameter);
Aspire.Hosting.PostgreSQL.Tests (6)
ConnectionPropertiesTests.cs (2)
15var resource = new PostgresServerResource("postgres", user, password); 58var server = new PostgresServerResource("postgres", user, password);
PostgrePublicApiTests.cs (4)
257var postgresParentResource = new PostgresServerResource("postgresServer", userName, builder.Resource); 277var postgresParentResource = new PostgresServerResource("postgresServer", userName, builder.Resource); 310var action = () => new PostgresServerResource(name, userName, builder.Resource); 325var action = () => new PostgresServerResource(name, userName, password);
Aspire.Hosting.Radius.Tests (2)
ResourceMapping\ResourceTypeMapperTests.cs (2)
99var resource = new PostgresServerResource("pgdb", null, password); 124var resource = new PostgresServerResource("pgdb", null, password);
78 references to PostgresServerResource
Aspire.Hosting.Azure.PostgreSQL (14)
AzurePostgresExtensions.cs (9)
23private static IResourceBuilder<T> WithLoginAndPassword<T>(this IResourceBuilder<T> builder, PostgresServerResource postgresResource) 36private static IResourceBuilder<PostgresServerResource> PublishAsAzurePostgresFlexibleServerInternal( 37this IResourceBuilder<PostgresServerResource> builder, 102public static IResourceBuilder<PostgresServerResource> PublishAsAzurePostgresFlexibleServer(this IResourceBuilder<PostgresServerResource> builder) 111public static IResourceBuilder<PostgresServerResource> AsAzurePostgresFlexibleServer(this IResourceBuilder<PostgresServerResource> builder) 220public static IResourceBuilder<AzurePostgresFlexibleServerResource> RunAsContainer(this IResourceBuilder<AzurePostgresFlexibleServerResource> builder, Action<IResourceBuilder<PostgresServerResource>>? configureContainer = null) 377var containerResource = azureResource.InnerResource;
AzurePostgresFlexibleServerResource.cs (2)
66internal PostgresServerResource? InnerResource { get; private set; } 215internal void SetInnerResource(PostgresServerResource innerResource)
AzurePostgresResource.cs (3)
11/// <param name="innerResource"><see cref="PostgresServerResource"/> that this resource wraps.</param> 14public class AzurePostgresResource(PostgresServerResource innerResource, Action<AzureResourceInfrastructure> configureInfrastructure) 17private readonly PostgresServerResource _innerResource = innerResource ?? throw new ArgumentNullException(nameof(innerResource));
Aspire.Hosting.Azure.Tests (5)
AzurePostgresExtensionsTests.cs (1)
164IResourceBuilder<PostgresServerResource>? innerPostgres = null;
PublicApiTests\PostgreSQLPublicApiTests.cs (4)
16IResourceBuilder<PostgresServerResource> builder = null!; 31IResourceBuilder<PostgresServerResource> builder = null!; 125PostgresServerResource innerResource = null!; 140var innerResource = new PostgresServerResource("postgre", userName, resource);
Aspire.Hosting.PostgreSQL (38)
PostgresBuilderExtensions.cs (33)
51public static IResourceBuilder<PostgresServerResource> AddPostgres(this IDistributedApplicationBuilder builder, 62var postgresServer = new PostgresServerResource(name, userName?.Resource, passwordParameter); 115.WithEndpoint(port: port, targetPort: 5432, name: PostgresServerResource.PrimaryEndpointName) // Internal port is always 5432. 146public static IResourceBuilder<PostgresServerResource> WithRepl(this IResourceBuilder<PostgresServerResource> builder) 153internal static async Task<TerminalLaunchOptions> CreateReplOptionsAsync(PostgresServerResource resource, CancellationToken cancellationToken) 187/// Note that calling <see cref="AddDatabase(IResourceBuilder{PostgresServerResource}, string, string?)"/> 194public static IResourceBuilder<PostgresDatabaseResource> AddDatabase(this IResourceBuilder<PostgresServerResource> builder, [ResourceName] string name, string? databaseName = null) 240where T : PostgresServerResource 269var postgresInstances = builder.ApplicationBuilder.Resources.OfType<PostgresServerResource>(); 353public static IResourceBuilder<PostgresServerResource> WithPgWeb(this IResourceBuilder<PostgresServerResource> builder, Action<IResourceBuilder<PgWebContainerResource>>? configureContainer = null, string? containerName = null) 466/// endpoint to every <see cref="PostgresServerResource"/> in the app. 475foreach (var postgresResource in @event.Model.Resources.OfType<PostgresServerResource>()) 532public static IResourceBuilder<PostgresServerResource> WithDataVolume(this IResourceBuilder<PostgresServerResource> builder, string? name = null, bool isReadOnly = false) 563public static IResourceBuilder<PostgresServerResource> WithDataBindMount(this IResourceBuilder<PostgresServerResource> builder, string source, bool isReadOnly = false) 583public static IResourceBuilder<PostgresServerResource> WithInitBindMount(this IResourceBuilder<PostgresServerResource> builder, string source, bool isReadOnly = true) 599public static IResourceBuilder<PostgresServerResource> WithInitFiles(this IResourceBuilder<PostgresServerResource> builder, string source) 642public static IResourceBuilder<PostgresServerResource> WithPassword(this IResourceBuilder<PostgresServerResource> builder, IResourceBuilder<ParameterResource> password) 659public static IResourceBuilder<PostgresServerResource> WithUserName(this IResourceBuilder<PostgresServerResource> builder, IResourceBuilder<ParameterResource> userName) 676public static IResourceBuilder<PostgresServerResource> WithHostPort(this IResourceBuilder<PostgresServerResource> builder, int? port) 679return builder.WithEndpoint(PostgresServerResource.PrimaryEndpointName, endpoint => 718private static async Task<string> WritePgAdminServerJson(IEnumerable<PostgresServerResource> postgresInstances, CancellationToken cancellationToken) 728foreach (var postgresInstance in postgresInstances) 767internal static string GetPostgresDataDirectoryPath(IResourceBuilder<PostgresServerResource> builder)
PostgresDatabaseResource.cs (4)
12/// A resource that represents a PostgreSQL database. This is a child resource of a <see cref="PostgresServerResource"/>. 20public class PostgresDatabaseResource(string name, string databaseName, PostgresServerResource postgresParentResource) 21: Resource(name), IResourceWithParent<PostgresServerResource>, IResourceWithConnectionString 26public PostgresServerResource Parent { get; } = postgresParentResource ?? throw new ArgumentNullException(nameof(postgresParentResource));
PostgresServerResource.cs (1)
16/// Initializes a new instance of the <see cref="PostgresServerResource"/> class.
Aspire.Hosting.PostgreSQL.Tests (16)
AddPostgresTests.cs (4)
179var postgresResource = Assert.Single(appModel.Resources.OfType<PostgresServerResource>()); 699var resource = Assert.Single(builder.Resources.OfType<PostgresServerResource>());
ConnectionPropertiesTests.cs (2)
15var resource = new PostgresServerResource("postgres", user, password); 58var server = new PostgresServerResource("postgres", user, password);
PostgrePublicApiTests.cs (10)
73IResourceBuilder<PostgresServerResource> builder = null!; 102IResourceBuilder<PostgresServerResource> builder = null!; 137IResourceBuilder<PostgresServerResource> builder = null!; 148IResourceBuilder<PostgresServerResource> builder = null!; 159IResourceBuilder<PostgresServerResource> builder = null!; 188IResourceBuilder<PostgresServerResource> builder = null!; 202IResourceBuilder<PostgresServerResource> builder = null!; 257var postgresParentResource = new PostgresServerResource("postgresServer", userName, builder.Resource); 277var postgresParentResource = new PostgresServerResource("postgresServer", userName, builder.Resource); 292PostgresServerResource postgresParentResource = null!;
Aspire.Hosting.Radius.Tests (2)
ResourceMapping\ResourceTypeMapperTests.cs (2)
99var resource = new PostgresServerResource("pgdb", null, password); 124var resource = new PostgresServerResource("pgdb", null, password);
Aspire.Hosting.Tests (3)
DistributedApplicationBuilderExtensionsTests.cs (2)
22var incorrectTypeException = Assert.Throws<InvalidOperationException>(() => appBuilder.CreateResourceBuilder<PostgresServerResource>("redis")); 60var result = appBuilder.TryCreateResourceBuilder<PostgresServerResource>("redis", out var builder);
ResourceNotificationTests.cs (1)
1063typeof(PostgresServerResource)