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:

  1. Tries to parse the name directly as an AuroraDbType enum member.
  2. Maps the two range type names that don’t match an AuroraDbType member name directly: tsrange → AuroraDbType.TimestampRange and tstzrange → AuroraDbType.TimestampTzRange.
  3. Returns null for the reflection-reported USER-DEFINED type (e.g. a native enum type, or a spatial type without the Npgsql plugin) — AuroraDbType has no Unknown member to fall back to.
  4. Otherwise, falls back to AuroraDbDbTypeNameToClientTypeResolver to get the .NET CLR type, then ClientTypeToAuroraDbTypeResolver to resolve that type into its AuroraDbType — returning null instead of throwing if that final step can’t resolve it either.

Usability

var resolver = new AuroraDbDbTypeNameToAuroraDbTypeResolver();
var auroraDbType = resolver.Resolve("uuid"); // AuroraDbType.Uuid