pgLab/pglablib/catalog/PgSequence.h

49 lines
1.1 KiB
C
Raw Permalink Normal View History

#ifndef PGSEQUENCE_H
#define PGSEQUENCE_H
#include "catalog/PgClass.h"
class PgSequence: public PgClass {
public:
2022-09-06 11:17:18 +00:00
enum Direction {
Ascending,
Descending
};
// values that define the trigger
// in recent versions from the catalog
Oid typid = InvalidOid;
int64_t start = 0;
int64_t increment = 0;
int64_t max = 0;
int64_t min = 0;
int64_t cache = 0;
bool cycled = false;
bool priv_usage = false;
bool priv_select = false;
bool priv_update = false;
2022-09-06 11:17:18 +00:00
// Sequence state data, retrieved by SELECTing the sequence
int64_t last = 0;
int64_t log = 0; // shows how many fetches are left before new wal log
bool called = false;
using PgClass::PgClass;
QString createSql() const;
2022-09-06 11:17:18 +00:00
Direction direction() const
{
return increment < 0 ? Descending : Ascending;
}
int64_t defaultMin() const;
int64_t defaultMax() const;
int64_t defaultStart() const;
int64_t defaultIncrement() const;
int64_t defaultCache() const;
// other option defaults are 1
QString nonDefaultOptionsString() const;
};
#endif // PGSEQUENCE_H