Moved several files from pglab project to pglablib
This commit is contained in:
parent
206d734ff5
commit
f4538069cb
44 changed files with 45 additions and 44 deletions
37
pglablib/PgAttribute.h
Normal file
37
pglablib/PgAttribute.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef PGATTRIBUTE_H
|
||||
#define PGATTRIBUTE_H
|
||||
|
||||
#include "Pgsql_declare.h"
|
||||
#include <QString>
|
||||
#include <libpq-fe.h>
|
||||
#include <tuple>
|
||||
|
||||
class PgAttribute {
|
||||
public:
|
||||
using Key = std::tuple<Oid, int16_t>;
|
||||
|
||||
// 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue