AuroraDbDbTypeNameToAuroraDbTypeResolver
A class used to resolve an Aurora PostgreSQL database type name into its equivalent AuroraDbType.
This IResolver<string, AuroraDbType?> implementation converts an Aurora PostgreSQL database type name into its equivalent RepoDb.Connector.AuroraDb.Npgsql.AuroraDbType. It resolves in four steps:
- Tries to parse the name directly as an
AuroraDbTypeenum member. - Maps the two range type names that don’t match an
AuroraDbTypemember name directly:tsrange→AuroraDbType.TimestampRangeandtstzrange→AuroraDbType.TimestampTzRange. - Returns
nullfor the reflection-reportedUSER-DEFINEDtype (e.g. a native enum type, or a spatial type without the Npgsql plugin) —AuroraDbTypehas noUnknownmember to fall back to. - Otherwise, falls back to AuroraDbDbTypeNameToClientTypeResolver to get the .NET CLR type, then ClientTypeToAuroraDbTypeResolver to resolve that type into its
AuroraDbType— returningnullinstead of throwing if that final step can’t resolve it either.
Usability
var resolver = new AuroraDbDbTypeNameToAuroraDbTypeResolver();
var auroraDbType = resolver.Resolve("uuid"); // AuroraDbType.Uuid