#ifndef PGATTRIBUTE_H #define PGATTRIBUTE_H #include "Pgsql_declare.h" #include #include #include class PgAttribute { public: using Key = std::tuple; // Oid oid = InvalidOid; Oid relid = InvalidOid; QString name; Oid typid = InvalidOid; int32_t stattarget = 0; int16_t num = 0; int32_t ndims = 0; // array dimensions int32_t typmod = -1; bool notnull = false; bool hasdef = false; Oid collation = InvalidOid; QString acl; QString options; QString defaultValue; ///< Comes from pg_attrdef table bool operator==(Key _k) const { return relid == std::get<0>(_k) && num == std::get<1>(_k); } bool operator==(const QString &n) const { return name == n; } bool operator<(Key _k) const { return relid < std::get<0>(_k) || (relid == std::get<0>(_k) && num < std::get<1>(_k)); } bool operator<(const PgAttribute &rhs) const { return relid < rhs.relid || (relid == rhs.relid && num < rhs.num); } }; #endif // PGATTRIBUTE_H