pgLab/pgtype.h
Eelke Klein 424cbc9e2e Started with classes for keeping track of the database schema.
Class to represent the contents of pg_type catalog table.
2017-01-25 06:53:30 +01:00

49 lines
1.5 KiB
C++

#ifndef PGTYPE_H
#define PGTYPE_H
#include <QString>
#include <pgsql/libpq-fe.h>
class PgType {
public:
PgType();
Oid oid = InvalidOid;
QString typname;//"name";"NO"
Oid typnamespace = InvalidOid;//"oid";"NO"
Oid typowner = InvalidOid;//"oid";"NO"
short typlen = -1;//"smallint";"NO"
bool typbyval = false;//"boolean";"NO"
QString typtype;//""char"";"NO"
QString typcategory;//""char"";"NO"
bool typispreferred = false;//"boolean";"NO"
bool typisdefined = false;//"boolean";"NO"
QString typdelim;//""char"";"NO"
Oid typrelid = InvalidOid;//"oid";"NO"
Oid typelem = InvalidOid;//"oid";"NO"
Oid typarray = InvalidOid;//"oid";"NO"
QString typinput;//regproc";"NO"
QString typoutput;//"regproc";"NO"
QString typreceive;//"regproc";"NO"
QString typsend;//"regproc";"NO"
QString typmodin;//"regproc";"NO"
QString typmodout;//"regproc";"NO"
QString typanalyze;//"regproc";"NO"
QString typalign;//""char"";"NO"
QString typstorage;//""char"";"NO"
bool typnotnull = false;//"boolean";"NO"
Oid typbasetype = InvalidOid;//"oid";"NO"
int typtypmod = -1;//"integer";"NO"
int typndims = 0;//"integer";"NO"
Oid typcollation = InvalidOid;//"oid";"NO"
QString typdefaultbin;//"pg_node_tree";"YES"
QString typdefault;//"text";"YES"
QString typacl;//"ARRAY";"YES"
bool operator==(Oid _oid) const { return oid == _oid; }
bool operator==(const QString &n) const { return typname == n; }
bool operator<(Oid _oid) const { return oid < _oid; }
bool operator<(const PgType &rhs) const { return oid < rhs.oid; }
};
#endif // PGTYPE_H