#pragma once #include "duckdb/common/types.hpp" #include "duckdb/common/types/date.hpp" #include "duckdb/common/types/datetime.hpp" #include "duckdb/common/types/timestamp.hpp" #include "duckdb/common/types/interval.hpp" namespace duckdb { //! Returns the PhysicalType for the given type template PhysicalType GetTypeId() { if (std::is_same()) { return PhysicalType::BOOL; } else if (std::is_same()) { return PhysicalType::INT8; } else if (std::is_same()) { return PhysicalType::INT16; } else if (std::is_same()) { return PhysicalType::INT32; } else if (std::is_same()) { return PhysicalType::INT64; } else if (std::is_same()) { return PhysicalType::UINT8; } else if (std::is_same()) { return PhysicalType::UINT16; } else if (std::is_same()) { return PhysicalType::UINT32; } else if (std::is_same()) { return PhysicalType::UINT64; } else if (std::is_same()) { return PhysicalType::INT128; } else if (std::is_same()) { return PhysicalType::INT32; } else if (std::is_same()) { return PhysicalType::INT64; } else if (std::is_same()) { return PhysicalType::INT64; } else if (std::is_same()) { return PhysicalType::FLOAT; } else if (std::is_same()) { return PhysicalType::DOUBLE; } else if (std::is_same() || std::is_same() || std::is_same()) { return PhysicalType::VARCHAR; } else if (std::is_same()) { return PhysicalType::INTERVAL; } else { return PhysicalType::INVALID; } } template bool TypeIsNumber() { return std::is_integral() || std::is_floating_point() || std::is_same(); } template bool IsValidType() { return GetTypeId() != PhysicalType::INVALID; } template bool IsIntegerType() { return TypeIsIntegral(GetTypeId()); } } // namespace duckdb