307 parse_schema_name(
string nname, reference<string> schema, reference<string> name);
351 list<hash<auto>> getTypeList();
354 list<string> getModifySql(
PgsqlType old, *hash opt);
387 constructor(
string n_name,
bool n_unique, hash n_cols, *
string n_tablespace) ;
426 softlist getRenameSql(
string table_name,
string new_name);
446 list getRenameSql(
string table_name,
string new_name);
468 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs, *
int scale)
539 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs,
626 list<auto> getRenameSql(
string table_name,
string new_name);
687 constructor(
string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end)
806 constructor(
string n,
string n_src,
string n_trigger) ;
818 const PGSQL_TempSavepoint =
"qore_pgsql_tmp_savepoint";
833 "authorization": True,
847 "currenttimestamp": True,
880 "localtimestamp": True,
921 list<string> featuresImpl();
932 PgsqlSequence makeSequenceImpl(
string name, number start = 1, number increment = 1, *softnumber end, *hash
opts);
937 *AbstractSequence getSequenceImpl(
string name);
942 *AbstractView getViewImpl(
string name);
957 *AbstractFunction getFunctionImpl(
string name);
962 AbstractFunction getProcedureImpl(
string name);
966 static *
string getFunctionArgs(
string err, reference<string> src);
971 list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
976 list getAlignSqlImpl(hash schema_hash, *hash opt);
1005 list<string> listSequencesImpl();
1010 list<string> listViewsImpl();
1100 *
string getDbName();
1123 static auto tryExecArgs(AbstractDatasource
ds,
string sql, *softlist<auto> args);
1151 const PgsqlColumnDescOptions = AbstractTable::ColumnDescOptions;
1153 const PgsqlIndexOptions = AbstractTable::IndexOptions;
1155 const PgsqlConstraintOptions = ...;
1158 const PgsqlTableCreationOptions = ...;
1161 const PgsqlAlignTableOptions = AbstractTable::AlignTableOptions + PgsqlTableCreationOptions;
1166 "exp": <DataProviderExpressionInfo>{
1167 "type": DET_Operator,
1170 "desc":
"cast operator",
1173 DataProviderSignatureAnyType,
1174 DataProviderSignatureStringValueType,
1175 DataProviderSignatureOptionalIntValueType,
1176 DataProviderSignatureOptionalIntValueType,
1178 "return_type": AbstractDataProviderTypeMap.
"any",
1180 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1181 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1182 AbstractDataProviderTypeMap.
"any");
1185 string sql = sprintf (
"cast (%s as %s", exp0,
name);
1186 if (desc.size == SZ_MAND) {
1187 if (!exists args[1] && !exists desc.size_range)
1188 throw "OPERATOR-ERROR", sprintf (
"cast operator missing size for type %s",
1190 sql += sprintf(
"(%d)", args[1] ?? desc.size_range[1]);
1191 }
else if (desc.size == SZ_NUM && exists args[1]) {
1192 sql += sprintf(
"(%d", args[1]);
1193 sql += exists args[2] ? sprintf(
",%d)", args[2]) :
")";
1194 }
else if (desc.size == SZ_OPT && exists args[1]) {
1195 sql += sprintf(
"(%d)", args[1]);
1202 "exp": <DataProviderExpressionInfo>{
1203 "type": DET_Operator,
1206 "desc":
"returns the year component of a date as a string (ex: `2022`)",
1209 DataProviderSignatureDateType,
1211 "return_type": AbstractDataProviderTypeMap.
"string",
1213 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1214 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1215 AbstractDataProviderTypeMap.
"date");
1216 return sprintf(
"to_char(%s, 'YYYY')", exp0);
1220 "exp": <DataProviderExpressionInfo>{
1221 "type": DET_Operator,
1222 "label": COP_YEAR_MONTH,
1223 "name": COP_YEAR_MONTH,
1224 "desc":
"returns the year and month components of a date as a string (ex: `2022-06`)",
1225 "symbol": COP_YEAR_MONTH,
1227 DataProviderSignatureDateType,
1229 "return_type": AbstractDataProviderTypeMap.
"string",
1231 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1232 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1233 AbstractDataProviderTypeMap.
"date");
1234 return sprintf(
"to_char(%s, 'YYYY-MM')", exp0);
1238 "exp": <DataProviderExpressionInfo>{
1239 "type": DET_Operator,
1240 "label": COP_YEAR_DAY,
1241 "name": COP_YEAR_DAY,
1242 "desc":
"returns the year, month, and day components of a date as a string (ex: `2022-06-29`)",
1243 "symbol": COP_YEAR_DAY,
1245 DataProviderSignatureDateType,
1247 "return_type": AbstractDataProviderTypeMap.
"string",
1249 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1250 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1251 AbstractDataProviderTypeMap.
"date");
1252 return sprintf(
"to_char(%s, 'YYYY-MM-DD')", exp0);
1256 "exp": <DataProviderExpressionInfo>{
1257 "type": DET_Operator,
1258 "label": COP_YEAR_HOUR,
1259 "name": COP_YEAR_HOUR,
1260 "desc":
"returns the year, month, day, and hour components of a date as a string "
1261 "(ex: `2022-06-29 15`)",
1262 "symbol": COP_YEAR_HOUR,
1264 DataProviderSignatureDateType,
1266 "return_type": AbstractDataProviderTypeMap.
"string",
1268 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1269 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1270 AbstractDataProviderTypeMap.
"date");
1271 return sprintf(
"to_char(%s, 'YYYY-MM-DD HH24')", exp0);
1275 "exp": <DataProviderExpressionInfo>{
1276 "type": DET_Operator,
1277 "label": COP_TRUNC_DATE,
1278 "name": COP_TRUNC_DATE,
1279 "desc":
"truncates the given date to the given resolution; args: date, string code: Y: year, "
1280 "M: month, D: day, H: hour, m: minute, S: second",
1281 "symbol": COP_TRUNC_DATE,
1283 DataProviderSignatureDateType,
1284 DataProviderSignatureStringValueType,
1286 "return_type": AbstractDataProviderTypeMap.
"date",
1288 "code":
string sub(reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1291 throw "TRUNC-DATE-ERROR", sprintf(
"unknown date truncation format argument %y; "
1292 "supported date format arguments: %y", args[1], keys
PgsqlTruncDate);
1294 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1295 AbstractDataProviderTypeMap.
"date");
1296 return sprintf(
"date_trunc(%s, %s)", str, exp0);
1300 "exp": <DataProviderExpressionInfo>{
1301 "type": DET_Operator,
1304 "desc":
"returns the next value in the given sequence; args: sequence name",
1307 DataProviderSignatureStringValueType,
1309 "return_type": AbstractDataProviderTypeMap.
"int",
1311 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1312 return sprintf(
"nextval('%s')", args[0]);
1316 "exp": <DataProviderExpressionInfo>{
1317 "type": DET_Operator,
1318 "label": COP_SEQ_CURRVAL,
1319 "name": COP_SEQ_CURRVAL,
1320 "desc":
"returns the current value in the given sequence; args: sequence name",
1321 "symbol": COP_SEQ_CURRVAL,
1323 DataProviderSignatureStringValueType,
1325 "return_type": AbstractDataProviderTypeMap.
"int",
1327 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1328 return sprintf(
"currval('%s')", args[0]);
1336 "code":
string sub (
string cve, list<auto> args) {
1339 string sql = sprintf (
"cast (%s as %s", cve,
name);
1342 if (desc.size == SZ_MAND) {
1343 if (!exists args[1] && !exists desc.size_range)
1344 throw "OPERATOR-ERROR", sprintf (
"op_cast operator missing size for type %s",
1346 sql += sprintf(
"(%d)", args[1] ?? desc.size_range[1]);
1347 }
else if (desc.size == SZ_NUM && exists args[1]) {
1348 sql += sprintf(
"(%d", args[1]);
1349 sql += exists args[2] ? sprintf(
",%d)", args[2]) :
")";
1350 }
else if (desc.size == SZ_OPT && exists args[1]) {
1351 sql += sprintf(
"(%d)", args[1]);
1359 "code":
string sub (
string arg1,
auto arg) {
1360 return sprintf(
"to_char(%s, 'YYYY')", arg1);
1364 "code":
string sub (
string arg1,
auto arg) {
1365 return sprintf(
"to_char(%s, 'YYYY-MM')", arg1);
1369 "code":
string sub (
string arg1,
auto arg) {
1370 return sprintf(
"to_char(%s, 'YYYY-MM-DD')", arg1);
1374 "code":
string sub (
string arg1,
auto arg) {
1375 return sprintf(
"to_char(%s, 'YYYY-MM-DD HH24')", arg1);
1381 "code":
string sub (*
string cve, hash arg, reference<hash> psch) {
1382 string sql = sprintf(
"nextval('%s')", arg.seq);
1385 sql +=
" " + arg.as;
1393 "code":
string sub (*
string cve, hash arg, reference<hash> psch) {
1394 string sql = sprintf(
"currval('%s')", arg.seq);
1397 sql +=
" " + arg.as;
1403 "code":
string sub(
string arg1,
auto arg) {
1405 throw "COP-TRUNC-DATE-ERROR", sprintf(
"Not allowed format argument: %n: allowed: %n", arg,
1467 PgsqlFunction addTriggerFunction(
string tfname,
string src,
string trigger);
1503 code getUpsertAuto(Columns cols, hash<auto> row, *hash<auto> opt);
1508 PgsqlFunction addTriggerFunctionUnlocked(
string tfname,
string src,
string trigger);
1517 hash getTableCreationOptions();
1522 hash getTableDescriptionHashOptions();
1527 hash getColumnDescOptions();
1532 hash getIndexOptions();
1537 hash getConstraintOptions();
1542 hash getAlignTableOptions();
1569 bool checkExistenceImpl();
1574 Columns describeImpl();
1584 Indexes getIndexesImpl();
1589 ForeignConstraints getForeignConstraintsImpl(*hash
opts);
1594 Constraints getConstraintsImpl();
1599 Triggers getTriggersImpl();
1610 *list getCreateMiscSqlImpl(*hash opt,
bool cache);
1615 *list getAlignSqlImpl(AbstractTable table, *hash<auto> opt);
1626 string getRenameSqlImpl(
string new_name);
1631 AbstractColumn addColumnImpl(
string cname, hash opt,
bool nullable = True);
1636 AbstractPrimaryKey addPrimaryKeyImpl(
string cname, hash ch, *hash opt);
1641 AbstractIndex addIndexImpl(
string iname,
bool enabled, hash ch, *hash opt);
1645 private AbstractForeignConstraint addForeignConstraintImpl(
string cname, hash<auto> ch,
string table,
1646 hash<auto> tch, *hash<auto> opt) {
1647 ForeignConstraintTarget fct(table,
new Columns(tch));
1652 AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *hash opt);
1657 AbstractUniqueConstraint addUniqueConstraintImpl(
string cname, hash ch, *hash opt);
1662 AbstractTrigger addTriggerImpl(
string tname,
string src, *hash opt);
1667 bool tryInsertImpl(
string sql, hash<auto> row);
1680 hash<auto> getQoreTypeMapImpl();
1685 hash<auto> getTypeMapImpl();
1709 softlist getDropSqlImpl();
1714 setupTableImpl(hash<auto> desc, *hash<auto> opt);
1745 doSelectOrderBySqlUnlocked(info, \sql, coll);
1746 if (info.query_hash.limit);
1749 if (info.query_hash.offset);
1772 *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
1777 list<auto> getGroupOrderByListUnlocked(hash<QueryInfo> info,
string key, list<auto> coll);
represents a PostgreSQL-specific check constraint
Definition: PgsqlSqlUtilBase.qm.dox.h:435
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
constructor(string n, string n_src)
creates the constraint from the supplied arguments
string getCreateSql(string name, string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
represents a PostgreSQL-specific column
Definition: PgsqlSqlUtilBase.qm.dox.h:455
int byte_size
byte size of the column
Definition: PgsqlSqlUtilBase.qm.dox.h:459
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, *int scale)
creates the column from the supplied arguments
string getNativeTypeString()
returns a string giving the native type of the column
constructor()
empty constructor for subclasses
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt)
returns a list of sql strings that can be used to modify the column to the new definition
list getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
string getDdlName(string name)
returns the column name with quoting in case the column name is a reserved word
bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
provides the PostgreSQL-specific implementation of the AbstractDatabase interface
Definition: PgsqlSqlUtilBase.qm.dox.h:811
auto tryExecRawImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
ListIterator materializedViewIterator()
returns an iterator listing the string materialized view names in the database
const PgsqlReservedWords
hash (set) of reserved words
Definition: PgsqlSqlUtilBase.qm.dox.h:825
ListIterator typeIterator()
returns an iterator listing the string type names in the database
hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
const PgsqlReclaimSpaceOptions
Options for reclaimSpace()
Definition: PgsqlSqlUtilBase.qm.dox.h:821
list< string > listFunctionsImpl()
returns a list of string function names in the database
bool supportsTypesImpl()
returns True if the database supports named types
list< string > listTablesImpl()
returns a list of string table names in the database
list< string > listMaterializedViews()
returns a list of string materialized view names in the database
reclaimSpaceImpl(*hash options)
reclaim space implementation. See SqlUtil::AbstractDatabase::reclaimSpace()
bool rebuildIndexImpl(string name, *hash options)
rebuild index implementation. See SqlUtil::AbstractDatabase::rebuildIndex()
list< string > listProceduresImpl()
since PostgreSQL only supports functions, this method is identical to listFunctionsImpl()
auto tryExecArgsImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
static string getCreateSql(list l)
returns a string that can be used to create the schema in the database
int getPhysicalSizeImpl()
SqlUtil::AbstractDatabase::getPhysicalSize()
bool supportsSequencesImpl()
returns True if the database supports sequences
hash getReclaimSpaceOptions()
returns driver-specific options to the base abstract class
string getCreateSqlImpl(list l)
returns a string that can be used to create the schema in the database
bool supportsPackagesImpl()
returns True if the database supports packages
const PgsqlSchemaDescriptionOptions
PostgreSQL-specific schema description keys.
Definition: PgsqlSqlUtilBase.qm.dox.h:815
static auto tryExecRaw(AbstractDatasource ds, string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost
computeStatisticsImpl(*hash options)
compute statistics implementation. See SqlUtil::AbstractDatabase::computeStatistics()
static auto tryExecArgs(AbstractDatasource ds, string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
softint getCurrentSequenceValueImpl(string name)
returns the last value issued for the given sequence in the current session
list< string > listTypes()
returns a list of string type names in the database
represents a PostgreSQL-specific foreign constraint
Definition: PgsqlSqlUtilBase.qm.dox.h:411
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
constructor(string n, Columns c, ForeignConstraintTarget t)
creates the constraint from the supplied arguments
string getCreateSql(string name, string table_name, *hash< auto > opt)
returns a string that can be used to create the constraint in the database
represents a PostgreSQL-specific function
Definition: PgsqlSqlUtilBase.qm.dox.h:762
setName(string new_name)
sets the new name of the function
string getDropSql(*hash opt)
returns a string that can be used to drop the function from the database
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
softlist< string > getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the function in the database
softlist< string > getCreateSql(*hash opt)
returns a string that can be used to create the function in the database
represents a PostgreSQL-specific index
Definition: PgsqlSqlUtilBase.qm.dox.h:380
constructor(string n_name, bool n_unique, hash n_cols, *string n_tablespace)
creates the object from the arguments
*string tablespace
the tablespace name of the index
Definition: PgsqlSqlUtilBase.qm.dox.h:384
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
string getDropSql(string table_name)
returns a string that can be used to drop the index from the database
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
the data type for PostgreSQL NUMBER columns
Definition: PgsqlSqlUtilBase.qm.dox.h:299
constructor(string native_type, bool nullable, *hash< auto > options)
creates the object
represents a PostgreSQL-specific numeric column
Definition: PgsqlSqlUtilBase.qm.dox.h:535
string getNativeTypeString()
returns a string giving the native type of the column
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, softint scale)
creates the column from the supplied arguments
represents a PostgreSQL-specific primary key constraint
Definition: PgsqlSqlUtilBase.qm.dox.h:639
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the constraint
string getCreateSql(string table_name, *hash< auto > opts)
returns a string that can be used to create the constraint
PgsqlColumn memberGate(string k)
returns the PgsqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
constructor(string n, *hash c, *string ts)
creates the object with the given attributes
constructor()
creates an empty primary key object
PostgreSQL savepoint helper.
Definition: PgsqlSqlUtilBase.qm.dox.h:311
constructor(AbstractDatasource ds, *string savepoint)
Creates the object.
deleteSavepointImpl()
Deletes the savepoint.
createSavepointImpl()
Creates the savepoint.
rollbackImpl()
Rolls back to the savepoint.
class for PostgreSQL sequences
Definition: PgsqlSqlUtilBase.qm.dox.h:683
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_end)
creates the object from the arguments
string getCreateSql(*hash opt)
returns a string that can be used to create the sequence in the database
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the sequence in the database
provides the PostgreSQL-specific implementation of the SqlUtil::AbstractTable interface
Definition: PgsqlSqlUtilBase.qm.dox.h:1130
const PgsqlNameMap
maps from verbose type names to simple type names
Definition: PgsqlSqlUtilBase.qm.dox.h:1138
copyImpl(AbstractTable old)
db-specific copy actions
int server_version_sub
PostgreSQL server version.
Definition: PgsqlSqlUtilBase.qm.dox.h:1448
hash< auto > getExpressionMap()
Returns the expression map for PostgreSQL.
const PgsqlIopMap
a hash of default value operator descriptions for PostgreSQL
Definition: PgsqlSqlUtilBase.qm.dox.h:1418
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifiers for schema,...
bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
const PgsqlUopMap
a hash of default update operator definitions for PostgreSQL
Definition: PgsqlSqlUtilBase.qm.dox.h:1422
hash getInsertOperatorMap()
returns the insert operator map for this object
bool has_atomic_merge
Set based on the postgreSQL server version.
Definition: PgsqlSqlUtilBase.qm.dox.h:1436
int server_version_major
PostgreSQL server major version.
Definition: PgsqlSqlUtilBase.qm.dox.h:1442
constructor(AbstractDatasource nds, string nname, *hash opts)
Creates the object from the arguments.
doSelectLimitOnlyUnlockedImpl(reference< hash< QueryInfo > > info, reference< string > sql)
processes a string for use in SQL select statements when there is a "limit" argument,...
private doSelectOrderByWithOffsetSqlUnlockedImpl(reference< hash< QueryInfo > > info, reference< string > sql, list< auto > coll)
processes a string for use in SQL select statements when there is an "order by" and "offset" argument
Definition: PgsqlSqlUtilBase.qm.dox.h:1743
auto tryExecArgsImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
AbstractDataProviderType getNumericTypeImpl(string native_type, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
const PgsqlCopMap
column operator specializations for PostgreSQL
Definition: PgsqlSqlUtilBase.qm.dox.h:1334
string getSchemaName()
returns the schema name
bool hasArrayBind()
returns False because the pgsql driver does not support array binds / bulk DML operations
const PgsqlTableDescriptionHashOptions
extends SqlUtil::AbstractTable::TableDescriptionHashOptions with "functions"
Definition: PgsqlSqlUtilBase.qm.dox.h:1148
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
string getCreateSqlImpl(list l)
returns a string that can be used to create the table in the database
bool supportsTablespacesImpl()
returns True if the database support tablespaces
string getCreateTableSqlImpl(*hash opt)
returns a string that can be used to create the table in the database
int server_version_minor
PostgreSQL server minor version.
Definition: PgsqlSqlUtilBase.qm.dox.h:1445
const PgsqlTypeMap
maps PostgreSQL type names to type configurations
Definition: PgsqlSqlUtilBase.qm.dox.h:1134
AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
string schema
schema name for the table
Definition: PgsqlSqlUtilBase.qm.dox.h:1430
transient Mutex pg_state()
Lock for atomicity for setting state info.
clearImpl()
clears PostgreSQL-specific table information
bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
code getUpsertClosure(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure for performing upserts
getServerVersion()
Sets the internal PostgreSQL server version.
auto tryExecRawImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
*string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
const PgsqlTruncDate
Map SqlUtil::cop_trunc_date() constants to PostgreSQL internal masks.
Definition: PgsqlSqlUtilBase.qm.dox.h:1414
bool hasAtomicUpsert()
Returns True if the server supports atomic upsert/merge operations.
*string getTablespaceName()
returns the data tablespace name for the table or NOTHING if none is known
int server_version
PostgreSQL server full version code.
Definition: PgsqlSqlUtilBase.qm.dox.h:1439
list< auto > getColumnSqlNames(softlist< auto > cols)
returns a list of column names for use in SQL strings
hash getColumnOperatorMapImpl()
returns the column operator map for this object
Functions triggerFunctions
contains any trigger functions supporting triggers on the table
Definition: PgsqlSqlUtilBase.qm.dox.h:1433
const QoreTypeMap
maps qore type names to PostgreSQL type names
Definition: PgsqlSqlUtilBase.qm.dox.h:1142
hash getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
const PgsqlExpressionMap
Expression map for PostgreSQL.
Definition: PgsqlSqlUtilBase.qm.dox.h:1164
*string tablespace
tablespace name for the table, if known
Definition: PgsqlSqlUtilBase.qm.dox.h:1427
represents a PostgreSQL-specific trigger function
Definition: PgsqlSqlUtilBase.qm.dox.h:800
string trigger
trigger name
Definition: PgsqlSqlUtilBase.qm.dox.h:804
represents a PostgreSQL-specific trigger
Definition: PgsqlSqlUtilBase.qm.dox.h:731
softlist< string > getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
string getNormalizedSource(string src)
returns normalized source for comparisons
softlist< string > getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the trigger in the database
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
softlist< string > getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
represents a PostgreSQL type
Definition: PgsqlSqlUtilBase.qm.dox.h:338
string getDropSql(*hash opt)
returns a string that can be used to drop the function from the database
string name
the name of the type
Definition: PgsqlSqlUtilBase.qm.dox.h:342
string getCreateSql(*hash opt)
returns a string that can be used to create the type in the database
string getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename a type
constructor(string n_name, string n_src)
creates the type from the supplied arguments
string src
the source of the type
Definition: PgsqlSqlUtilBase.qm.dox.h:345
bool equal(PgsqlType type)
returns True if the types are equal
common base class for unique constraints
Definition: PgsqlSqlUtilBase.qm.dox.h:549
bool setIndexBase(string ix)
sets the supporting index name
getIndexSql(reference< string > sql, string name, *hash opts)
adds index options onto the sql creation string
clearIndex()
clears any index base for the constraint
constructor(*string ts)
creates the constraint with an optional tablespace name
setTablespace(*string ts)
sets or clears the tablespace name
*string getTablespace()
returns the tablespace name used for this constraint, if known
*string tablespace
any tablespace for the unique key index
Definition: PgsqlSqlUtilBase.qm.dox.h:554
class modeling a unique constraint
Definition: PgsqlSqlUtilBase.qm.dox.h:584
constructor(string n, hash n_cols, bool e=True, *string ts)
creates the object with the given attributes
bool isEnabled()
returns True if the constraint is enabled, False if not
string getCreateSql(string name, string table_name, *hash< auto > opts)
returns a string that can be used to rename the constraint
PgsqlColumn memberGate(string k)
returns the PgsqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
string getCreateSql(string table_name, *hash opts)
returns a string that can be used to create the constraint
bool enabled
True if the constraint is enabled, False if not
Definition: PgsqlSqlUtilBase.qm.dox.h:589
represents a PostgreSQL view
Definition: PgsqlSqlUtilBase.qm.dox.h:705
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the view in the database
constructor(string n_name, string n_src, *string n_schemaname, *string n_viewowner)
creates the object from the arguments
*string viewowner
Owner of the view.
Definition: PgsqlSqlUtilBase.qm.dox.h:709
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
transient AbstractDatasource ds
cache(*hash< auto > opts)
the PgsqlSqlUtilBase namespace contains all the objects in the PgsqlSqlUtilBase module
Definition: PgsqlSqlUtilBase.qm.dox.h:289
PgsqlTable get_table(AbstractDatasource nds, string nname, *hash< auto > opts)
returns a PgsqlTable object corresponding to the arguments
PgsqlDatabase get_database(AbstractDatasource nds, *hash< auto > opts)
returns a PgsqlDatabase object corresponding to the arguments