Tab with list of sequences and create sql for selected sequence.
This commit is contained in:
parent
769307c821
commit
437736a023
19 changed files with 507 additions and 63 deletions
23
pglablib/catalog/PgSequence.cpp
Normal file
23
pglablib/catalog/PgSequence.cpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include "PgSequence.h"
|
||||
#include "PgDatabaseCatalog.h"
|
||||
#include "PgTypeContainer.h"
|
||||
#include <QStringBuilder>
|
||||
|
||||
QString PgSequence::createSql() const
|
||||
{
|
||||
QString sql;
|
||||
sql = "CREATE";
|
||||
// [ TEMPORARY | TEMP ]
|
||||
sql += " SEQUENCE " % fullyQualifiedQuotedObjectName();
|
||||
if (catalog().serverVersion() >= 100000)
|
||||
sql += "\n AS " % catalog().types()->getByKey(typid)->objectName();
|
||||
sql += QString("\n INCREMENT %1\n MINVALUE %2"
|
||||
" MAXVALUE %3\n START %4 CACHE %5")
|
||||
.arg(increment).arg(min).arg(max).arg(start).arg(cache);
|
||||
if (cycled)
|
||||
sql += "\n CYCLE";
|
||||
|
||||
// [ OWNED BY { table_name.column_name | NONE } ]
|
||||
sql += ";";
|
||||
return sql;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue