Skip to content

Commit ecf3e6d

Browse files
committed
5.0.0-preview017debug PostgreSQL
1 parent 75dc125 commit ecf3e6d

10 files changed

Lines changed: 14 additions & 14 deletions

File tree

AuthPermissions.AspNetCore/CreateNuGetDebug.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata>
44
<id>AuthPermissions.AspNetCore</id>
5-
<version>5.0.0-preview015debug</version>
5+
<version>5.0.0-preview017debug</version>
66
<authors>Jon P Smith</authors>
77
<product>AuthPermissions.AspNetCore</product>
88
<copyright>Copyright (c) 2021 Jon P Smith</copyright>

AuthPermissions.AspNetCore/MultiProjPack.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- See documentation for all the possible values -->
55
<metadata>
66
<id>AuthPermissions.AspNetCore</id>
7-
<version>5.0.0-preview015debug</version>
7+
<version>5.0.0-preview017debug</version>
88
<authors>Jon P Smith</authors>
99
<product>AuthPermissions.AspNetCore</product>
1010
<copyright>Copyright (c) 2021 Jon P Smith</copyright>

AuthPermissions.AspNetCore/SetupExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public static AuthSetupData SetupMultiTenantSharding(this AuthSetupData setupDat
202202
case AuthPDatabaseTypes.SqlServer:
203203
setupData.Services.AddScoped<IDatabaseSpecificMethods, SqlServerDatabaseSpecificMethods>();
204204
break;
205-
case AuthPDatabaseTypes.Postgres:
205+
case AuthPDatabaseTypes.PostgreSQL:
206206
setupData.Services.AddScoped<IDatabaseSpecificMethods, PostgresDatabaseSpecificMethods>();
207207
break;
208208
case AuthPDatabaseTypes.CustomDatabase:

AuthPermissions.AspNetCore/ShardingServices/DatabaseInformation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ string GetShortDatabaseProviderName()
6161
return "Sqlite";
6262
case AuthPDatabaseTypes.SqlServer:
6363
return "SqlServer";
64-
case AuthPDatabaseTypes.Postgres:
64+
case AuthPDatabaseTypes.PostgreSQL:
6565
return "PostgreSQL";
6666
case AuthPDatabaseTypes.CustomDatabase:
6767
if(authPContext == null)

AuthPermissions.AspNetCore/ShardingServices/PostgresDatabaseSpecificMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class PostgresDatabaseSpecificMethods : IDatabaseSpecificMethods
1818
/// <summary>
1919
/// This is used select the <see cref="IDatabaseSpecificMethods"/> from the AuthP's <see cref="SetupInternalData.AuthPDatabaseType"/>
2020
/// </summary>
21-
public AuthPDatabaseTypes AuthPDatabaseType => AuthPDatabaseTypes.Postgres;
21+
public AuthPDatabaseTypes AuthPDatabaseType => AuthPDatabaseTypes.PostgreSQL;
2222

2323
/// <summary>
2424
/// This contains the short name of EF Core Database Provider that this service supports

AuthPermissions.BaseCode/SetupCode/DatabaseTypes.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public enum AuthPDatabaseTypes
2121
/// </summary>
2222
SqlServer,
2323
/// <summary>
24-
/// Postgres database is used
24+
/// Postgres database is used (NOTE: the Enum name matches the EF Core's ProviderName
2525
/// </summary>
26-
Postgres,
26+
PostgreSQL,
2727
/// <summary>
28-
/// This says that you have provided a database type other than the built-in <see cref="SqlServer"/> or <see cref="Postgres"/>.
28+
/// This says that you have provided a database type other than the built-in <see cref="SqlServer"/> or <see cref="PostgreSQL"/>.
2929
/// </summary>
3030
CustomDatabase
3131

AuthPermissions/SetupExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public static AuthSetupData UsingEfCorePostgres(this AuthSetupData setupData, st
112112
.MigrationsAssembly("AuthPermissions.PostgreSql"));
113113
EntityFramework.Exceptions.PostgreSQL.ExceptionProcessorExtensions.UseExceptionProcessor(options);
114114
});
115-
setupData.Options.InternalData.AuthPDatabaseType = AuthPDatabaseTypes.Postgres;
115+
setupData.Options.InternalData.AuthPDatabaseType = AuthPDatabaseTypes.PostgreSQL;
116116

117117
setupData.Options.InternalData.RunSequentiallyOptions =
118118
setupData.Services.RegisterRunMethodsSequentially(options =>

Test/StubClasses/StubConnectionsService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public StubConnectionsService(object caller)
2727
DatabaseProviderMethods = new Dictionary<AuthPDatabaseTypes, IDatabaseSpecificMethods>
2828
{
2929
{ AuthPDatabaseTypes.SqlServer, new SqlServerDatabaseSpecificMethods() },
30-
{ AuthPDatabaseTypes.Postgres, new PostgresDatabaseSpecificMethods() },
30+
{ AuthPDatabaseTypes.PostgreSQL, new PostgresDatabaseSpecificMethods() },
3131
{ AuthPDatabaseTypes.SqliteInMemory, new StubSqliteDatabaseSpecificMethods() },
3232
};
3333
ShardingDatabaseProviders = new Dictionary<string, IDatabaseSpecificMethods>

Test/UnitTests/TestSharding/TestAccessDatabaseInformation.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private static void ResetShardingSettingsFile()
4848
{
4949
new (){ Name = "Default Database", ConnectionName = "UnitTestConnection", DatabaseType = nameof(AuthPDatabaseTypes.SqlServer)},
5050
new (){ Name = "Other Database", DatabaseName = "MyDatabase1", ConnectionName = "UnitTestConnection", DatabaseType = nameof(AuthPDatabaseTypes.SqlServer) },
51-
new (){ Name = "PostgreSql1", ConnectionName = "PostgreSqlConnection", DatabaseName = "StubTest", DatabaseType = nameof(AuthPDatabaseTypes.Postgres) }
51+
new (){ Name = "PostgreSql1", ConnectionName = "PostgreSqlConnection", DatabaseName = "StubTest", DatabaseType = nameof(AuthPDatabaseTypes.PostgreSQL) }
5252
}
5353
};
5454
var jsonString = JsonSerializer.Serialize(testData, new JsonSerializerOptions { WriteIndented = true });
@@ -243,15 +243,15 @@ public void TestAddDatabaseInfoToJsonFile_PostgresLock()
243243
var stubEnv = new StubWebHostEnvironment { ContentRootPath = TestData.GetTestDataDir(), EnvironmentName = "Test" };
244244
var stubCon = new StubConnectionsService(this);
245245
var service = new AccessDatabaseInformationJsonFile(stubEnv, stubCon, context,
246-
FormAuthOptionsForSharding(AuthPDatabaseTypes.Postgres), "en".SetupAuthPLoggingLocalizer());
246+
FormAuthOptionsForSharding(AuthPDatabaseTypes.PostgreSQL), "en".SetupAuthPLoggingLocalizer());
247247

248248
//ATTEMPT
249249
Parallel.ForEach(new string[] { "Name1", "Name2", "Name3" },
250250
name =>
251251
{
252252
var databaseInfo = new DatabaseInformation
253253
{
254-
DatabaseType = nameof(AuthPDatabaseTypes.Postgres),
254+
DatabaseType = nameof(AuthPDatabaseTypes.PostgreSQL),
255255
Name = name, DatabaseName = $"Database{name}", ConnectionName = "UnitTestConnection"
256256
};
257257
var status = service.AddDatabaseInfoToShardingInformation(databaseInfo);

Test/UnitTests/TestSharding/TestShardingConnectionString.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public void TestGetNamedConnectionStringPostgres()
204204
{
205205
//SETUP
206206
var service = new ShardingConnectionsJsonFile(_connectSnapshot, _shardingSnapshot,
207-
null, FormAuthOptionsForSharding(AuthPDatabaseTypes.Postgres),
207+
null, FormAuthOptionsForSharding(AuthPDatabaseTypes.PostgreSQL),
208208
ShardingHelpers.GetDatabaseSpecificMethods(),
209209
"en".SetupAuthPLoggingLocalizer());
210210

0 commit comments

Comments
 (0)