using System; using System.Data; using System.Diagnostics.CodeAnalysis; using Npgsql.Internal.Postgres; namespace Npgsql.Internal; /// /// An Npgsql resolver for DbType. Used by Npgsql to resolve a DbType to DataTypeName and back. /// [Experimental(NpgsqlDiagnostics.DbTypeResolverExperimental)] public interface IDbTypeResolver { /// /// Attempts to resolve a DbType to a data type name. /// /// The DbType name to resolve. /// The type of the value to resolve a data type name for. /// The data type name if it could be mapped, the name can be non-normalized and without schema. string? GetDataTypeName(DbType dbType, Type? type); /// /// Attempts to resolve a data type name to a DbType. /// /// The data type name to map, in a normalized form but possibly without schema. /// The DbType if it could be mapped, null otherwise. DbType? GetDbType(DataTypeName dataTypeName); }