AuroraDbDbTypeNameToClientTypeResolver

A class used to resolve an Aurora PostgreSQL database type name into its equivalent .NET CLR type.

This IResolver<string, Type> implementation converts an Aurora PostgreSQL database type name — as returned by information_schema.columns.data_type — into its equivalent .NET CLR type (e.g. character varying/text/jsonb → string, numeric/decimal → decimal, bytea/bytes → byte[], uuid → Guid, date → DateOnly, timestamp with time zone → DateTimeOffset). It is the default DbTypeResolver used by AuroraDbDbHelper.

The spatial (geometry, geography) types have no CLR representation without an Npgsql plugin such as Npgsql.NetTopologySuite (not referenced by this package), and any other extension type is reported by the schema as USER-DEFINED. These, along with any other unrecognized type name, fall back to typeof(object).

Usability

var resolver = new AuroraDbDbTypeNameToClientTypeResolver();
var clrType = resolver.Resolve("uuid"); // typeof(Guid)