#pragma once #include #include #include namespace DB { /// Data types for representing elementary values from a database in RAM. struct Null {}; using UInt8 = uint8_t; using UInt16 = uint16_t; using UInt32 = uint32_t; using UInt64 = uint64_t; using Int8 = int8_t; using Int16 = int16_t; using Int32 = int32_t; using Int64 = int64_t; using Int128 = __int128; using Float32 = float; using Float64 = double; using String = std::string; /** Note that for types not used in DB, IsNumber is false. */ template constexpr bool IsNumber = false; template <> constexpr bool IsNumber = true; template <> constexpr bool IsNumber = true; template <> constexpr bool IsNumber = true; template <> constexpr bool IsNumber = true; template <> constexpr bool IsNumber = true; template <> constexpr bool IsNumber = true; template <> constexpr bool IsNumber = true; template <> constexpr bool IsNumber = true; template <> constexpr bool IsNumber = true; template <> constexpr bool IsNumber = true; template struct TypeName; template <> struct TypeName { static const char * get() { return "UInt8"; } }; template <> struct TypeName { static const char * get() { return "UInt16"; } }; template <> struct TypeName { static const char * get() { return "UInt32"; } }; template <> struct TypeName { static const char * get() { return "UInt64"; } }; template <> struct TypeName { static const char * get() { return "Int8"; } }; template <> struct TypeName { static const char * get() { return "Int16"; } }; template <> struct TypeName { static const char * get() { return "Int32"; } }; template <> struct TypeName { static const char * get() { return "Int64"; } }; template <> struct TypeName { static const char * get() { return "Int128"; } }; template <> struct TypeName { static const char * get() { return "Float32"; } }; template <> struct TypeName { static const char * get() { return "Float64"; } }; template <> struct TypeName { static const char * get() { return "String"; } }; /// Not a data type in database, defined just for convenience. using Strings = std::vector; }