306 parse_schema_name(
string nname, reference<string> schema, reference<string> name);
353 list getModifySql(
PgsqlType old, *hash opt);
386 constructor(
string n_name,
bool n_unique, hash n_cols, *
string n_tablespace) ;
425 softlist getRenameSql(
string table_name,
string new_name);
445 list getRenameSql(
string table_name,
string new_name);
467 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs, *
int scale)
538 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs,
625 list<auto> getRenameSql(
string table_name,
string new_name);
686 constructor(
string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end) ;
803 constructor(
string n,
string n_src,
string n_trigger) ;
815 const PGSQL_TempSavepoint =
"qore_pgsql_tmp_savepoint";
830 "authorization": True,
844 "currenttimestamp": True,
877 "localtimestamp": True,
918 list<string> featuresImpl();
929 PgsqlSequence makeSequenceImpl(
string name, number start = 1, number increment = 1, *softnumber end, *hash
opts);
934 *AbstractSequence getSequenceImpl(
string name);
939 *AbstractView getViewImpl(
string name);
954 *AbstractFunction getFunctionImpl(
string name);
959 AbstractFunction getProcedureImpl(
string name);
963 static *
string getFunctionArgs(
string err, reference<string> src);
968 list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
973 list getAlignSqlImpl(hash schema_hash, *hash opt);
1002 list<string> listSequencesImpl();
1007 list<string> listViewsImpl();
1115 static auto tryExecArgs(AbstractDatasource
ds,
string sql, *softlist<auto> args);
1143 const PgsqlColumnDescOptions = AbstractTable::ColumnDescOptions;
1145 const PgsqlIndexOptions = AbstractTable::IndexOptions;
1147 const PgsqlConstraintOptions = ...;
1150 const PgsqlTableCreationOptions = ...;
1153 const PgsqlAlignTableOptions = AbstractTable::AlignTableOptions + PgsqlTableCreationOptions;
1158 "exp": <DataProviderExpressionInfo>{
1159 "type": DET_Operator,
1162 "desc":
"cast operator",
1165 DataProviderSignatureAnyType,
1166 DataProviderSignatureStringValueType,
1167 DataProviderSignatureOptionalIntValueType,
1168 DataProviderSignatureOptionalIntValueType,
1170 "return_type": AbstractDataProviderTypeMap.
"any",
1172 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1173 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1174 AbstractDataProviderTypeMap.
"any");
1177 string sql = sprintf (
"cast (%s as %s", exp0,
name);
1178 if (desc.size == SZ_MAND) {
1179 if (!exists args[1] && !exists desc.size_range)
1180 throw "OPERATOR-ERROR", sprintf (
"cast operator missing size for type %s",
1182 sql += sprintf(
"(%d)", args[1] ?? desc.size_range[1]);
1183 }
else if (desc.size == SZ_NUM && exists args[1]) {
1184 sql += sprintf(
"(%d", args[1]);
1185 sql += exists args[2] ? sprintf(
",%d)", args[2]) :
")";
1186 }
else if (desc.size == SZ_OPT && exists args[1]) {
1187 sql += sprintf(
"(%d)", args[1]);
1194 "exp": <DataProviderExpressionInfo>{
1195 "type": DET_Operator,
1198 "desc":
"returns the year component of a date as a string (ex: `2022`)",
1201 DataProviderSignatureDateType,
1203 "return_type": AbstractDataProviderTypeMap.
"string",
1205 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1206 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1207 AbstractDataProviderTypeMap.
"date");
1208 return sprintf(
"to_char(%s, 'YYYY')", exp0);
1212 "exp": <DataProviderExpressionInfo>{
1213 "type": DET_Operator,
1214 "label": COP_YEAR_MONTH,
1215 "name": COP_YEAR_MONTH,
1216 "desc":
"returns the year and month components of a date as a string (ex: `2022-06`)",
1217 "symbol": COP_YEAR_MONTH,
1219 DataProviderSignatureDateType,
1221 "return_type": AbstractDataProviderTypeMap.
"string",
1223 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1224 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1225 AbstractDataProviderTypeMap.
"date");
1226 return sprintf(
"to_char(%s, 'YYYY-MM')", exp0);
1230 "exp": <DataProviderExpressionInfo>{
1231 "type": DET_Operator,
1232 "label": COP_YEAR_DAY,
1233 "name": COP_YEAR_DAY,
1234 "desc":
"returns the year, month, and day components of a date as a string (ex: `2022-06-29`)",
1235 "symbol": COP_YEAR_DAY,
1237 DataProviderSignatureDateType,
1239 "return_type": AbstractDataProviderTypeMap.
"string",
1241 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1242 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1243 AbstractDataProviderTypeMap.
"date");
1244 return sprintf(
"to_char(%s, 'YYYY-MM-DD')", exp0);
1248 "exp": <DataProviderExpressionInfo>{
1249 "type": DET_Operator,
1250 "label": COP_YEAR_HOUR,
1251 "name": COP_YEAR_HOUR,
1252 "desc":
"returns the year, month, day, and hour components of a date as a string "
1253 "(ex: `2022-06-29 15`)",
1254 "symbol": COP_YEAR_HOUR,
1256 DataProviderSignatureDateType,
1258 "return_type": AbstractDataProviderTypeMap.
"string",
1260 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1261 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1262 AbstractDataProviderTypeMap.
"date");
1263 return sprintf(
"to_char(%s, 'YYYY-MM-DD HH24')", exp0);
1267 "exp": <DataProviderExpressionInfo>{
1268 "type": DET_Operator,
1269 "label": COP_TRUNC_DATE,
1270 "name": COP_TRUNC_DATE,
1271 "desc":
"truncates the given date to the given resolution; args: date, string code: Y: year, "
1272 "M: month, D: day, H: hour, m: minute, S: second",
1273 "symbol": COP_TRUNC_DATE,
1275 DataProviderSignatureDateType,
1276 DataProviderSignatureStringValueType,
1278 "return_type": AbstractDataProviderTypeMap.
"date",
1280 "code":
string sub(reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1283 throw "TRUNC-DATE-ERROR", sprintf(
"unknown date truncation format argument %y; "
1284 "supported date format arguments: %y", args[1], keys
PgsqlTruncDate);
1286 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1287 AbstractDataProviderTypeMap.
"date");
1288 return sprintf(
"date_trunc(%s, %s)", str, exp0);
1292 "exp": <DataProviderExpressionInfo>{
1293 "type": DET_Operator,
1296 "desc":
"returns the next value in the given sequence; args: sequence name",
1299 DataProviderSignatureStringValueType,
1301 "return_type": AbstractDataProviderTypeMap.
"int",
1303 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1304 return sprintf(
"nextval('%s')", args[0]);
1308 "exp": <DataProviderExpressionInfo>{
1309 "type": DET_Operator,
1310 "label": COP_SEQ_CURRVAL,
1311 "name": COP_SEQ_CURRVAL,
1312 "desc":
"returns the current value in the given sequence; args: sequence name",
1313 "symbol": COP_SEQ_CURRVAL,
1315 DataProviderSignatureStringValueType,
1317 "return_type": AbstractDataProviderTypeMap.
"int",
1319 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1320 return sprintf(
"currval('%s')", args[0]);
1328 "code":
string sub (
string cve, list<auto> args) {
1331 string sql = sprintf (
"cast (%s as %s", cve,
name);
1334 if (desc.size == SZ_MAND) {
1335 if (!exists args[1] && !exists desc.size_range)
1336 throw "OPERATOR-ERROR", sprintf (
"op_cast operator missing size for type %s",
1338 sql += sprintf(
"(%d)", args[1] ?? desc.size_range[1]);
1339 }
else if (desc.size == SZ_NUM && exists args[1]) {
1340 sql += sprintf(
"(%d", args[1]);
1341 sql += exists args[2] ? sprintf(
",%d)", args[2]) :
")";
1342 }
else if (desc.size == SZ_OPT && exists args[1]) {
1343 sql += sprintf(
"(%d)", args[1]);
1351 "code":
string sub (
string arg1,
auto arg) {
1352 return sprintf(
"to_char(%s, 'YYYY')", arg1);
1356 "code":
string sub (
string arg1,
auto arg) {
1357 return sprintf(
"to_char(%s, 'YYYY-MM')", arg1);
1361 "code":
string sub (
string arg1,
auto arg) {
1362 return sprintf(
"to_char(%s, 'YYYY-MM-DD')", arg1);
1366 "code":
string sub (
string arg1,
auto arg) {
1367 return sprintf(
"to_char(%s, 'YYYY-MM-DD HH24')", arg1);
1373 "code":
string sub (*
string cve, hash arg, reference<hash> psch) {
1374 string sql = sprintf(
"nextval('%s')", arg.seq);
1377 sql +=
" " + arg.as;
1385 "code":
string sub (*
string cve, hash arg, reference<hash> psch) {
1386 string sql = sprintf(
"currval('%s')", arg.seq);
1389 sql +=
" " + arg.as;
1395 "code":
string sub(
string arg1,
auto arg) {
1397 throw "COP-TRUNC-DATE-ERROR", sprintf(
"Not allowed format argument: %n: allowed: %n", arg,
1459 PgsqlFunction addTriggerFunction(
string tfname,
string src,
string trigger);
1495 code getUpsertAuto(Columns cols, hash<auto> row, *hash<auto> opt);
1500 PgsqlFunction addTriggerFunctionUnlocked(
string tfname,
string src,
string trigger);
1509 hash getTableCreationOptions();
1514 hash getTableDescriptionHashOptions();
1519 hash getColumnDescOptions();
1524 hash getIndexOptions();
1529 hash getConstraintOptions();
1534 hash getAlignTableOptions();
1561 bool checkExistenceImpl();
1566 Columns describeImpl();
1576 Indexes getIndexesImpl();
1581 ForeignConstraints getForeignConstraintsImpl(*hash
opts);
1586 Constraints getConstraintsImpl();
1591 Triggers getTriggersImpl();
1602 *list getCreateMiscSqlImpl(*hash opt,
bool cache);
1607 *list getAlignSqlImpl(AbstractTable table, *hash<auto> opt);
1618 string getRenameSqlImpl(
string new_name);
1623 AbstractColumn addColumnImpl(
string cname, hash opt,
bool nullable = True);
1628 AbstractPrimaryKey addPrimaryKeyImpl(
string cname, hash ch, *hash opt);
1633 AbstractIndex addIndexImpl(
string iname,
bool enabled, hash ch, *hash opt);
1637 private AbstractForeignConstraint addForeignConstraintImpl(
string cname, hash<auto> ch,
string table,
1638 hash<auto> tch, *hash<auto> opt) {
1639 ForeignConstraintTarget fct(table,
new Columns(tch));
1644 AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *hash opt);
1649 AbstractUniqueConstraint addUniqueConstraintImpl(
string cname, hash ch, *hash opt);
1654 AbstractTrigger addTriggerImpl(
string tname,
string src, *hash opt);
1659 bool tryInsertImpl(
string sql, hash<auto> row);
1672 hash<auto> getQoreTypeMapImpl();
1677 hash<auto> getTypeMapImpl();
1701 softlist getDropSqlImpl();
1706 setupTableImpl(hash<auto> desc, *hash<auto> opt);
1737 doSelectOrderBySqlUnlocked(info, \sql, coll);
1738 if (info.query_hash.limit);
1741 if (info.query_hash.offset);
1764 *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
1769 list<auto> getGroupOrderByListUnlocked(hash<QueryInfo> info,
string key, list<auto> coll);
represents a PostgreSQL-specific check constraint
Definition: PgsqlSqlUtil.qm.dox.h:434
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
string getCreateSql(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: PgsqlSqlUtil.qm.dox.h:454
constructor()
empty constructor for subclasses
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
string getNativeTypeString()
returns a string giving the native type of the column
bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
int byte_size
byte size of the column
Definition: PgsqlSqlUtil.qm.dox.h:458
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
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 getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
provides the PostgreSQL-specific implementation of the AbstractDatabase interface
Definition: PgsqlSqlUtil.qm.dox.h:808
list< string > listFunctionsImpl()
returns a list of string function names in the database
list< string > listTablesImpl()
returns a list of string table names in the database
bool rebuildIndexImpl(string name, *hash options)
rebuild index implementation. See SqlUtil::AbstractDatabase::rebuildIndex()
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
list< string > listProceduresImpl()
since PostgreSQL only supports functions, this method is identical to listFunctionsImpl()
static string getCreateSql(list l)
returns a string that can be used to create the schema in the database
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
const PgsqlReclaimSpaceOptions
Options for reclaimSpace()
Definition: PgsqlSqlUtil.qm.dox.h:818
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
hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
bool supportsPackagesImpl()
returns True if the database supports packages
const PgsqlSchemaDescriptionOptions
PostgreSQL-specific schema description keys.
Definition: PgsqlSqlUtil.qm.dox.h:812
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
reclaimSpaceImpl(*hash options)
reclaim space implementation. See SqlUtil::AbstractDatabase::reclaimSpace()
string getCreateSqlImpl(list l)
returns a string that can be used to create the schema in the database
ListIterator materializedViewIterator()
returns an iterator listing the string materialized view names in the database
const PgsqlReservedWords
hash (set) of reserved words
Definition: PgsqlSqlUtil.qm.dox.h:822
hash getReclaimSpaceOptions()
returns driver-specific options to the base abstract class
ListIterator typeIterator()
returns an iterator listing the string type names in the database
bool supportsSequencesImpl()
returns True if the database supports sequences
bool supportsTypesImpl()
returns True if the database supports named types
softint getCurrentSequenceValueImpl(string name)
returns the last value issued for the given sequence in the current session
int getPhysicalSizeImpl()
SqlUtil::AbstractDatabase::getPhysicalSize()
list< string > listMaterializedViews()
returns a list of string materialized view names in the database
list< string > listTypes()
returns a list of string type names in the database
softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
computeStatisticsImpl(*hash options)
compute statistics implementation. See SqlUtil::AbstractDatabase::computeStatistics()
represents a PostgreSQL-specific foreign constraint
Definition: PgsqlSqlUtil.qm.dox.h:410
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from 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
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
represents a PostgreSQL-specific function
Definition: PgsqlSqlUtil.qm.dox.h:760
softlist getCreateSql(*hash opt)
returns a string that can be used to create the function in the database
string getDropSql(*hash opt)
returns a string that can be used to drop the function from the database
setName(string new_name)
sets the new name of the function
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the function in the database
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
represents a PostgreSQL-specific index
Definition: PgsqlSqlUtil.qm.dox.h:379
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
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: PgsqlSqlUtil.qm.dox.h:383
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
string getDropSql(string table_name)
returns a string that can be used to drop the index from the database
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
the data type for PostgreSQL NUMBER columns
Definition: PgsqlSqlUtil.qm.dox.h:298
constructor(string native_type, bool nullable, *hash< auto > options)
creates the object
represents a PostgreSQL-specific numeric column
Definition: PgsqlSqlUtil.qm.dox.h:534
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
string getNativeTypeString()
returns a string giving the native type of the column
represents a PostgreSQL-specific primary key constraint
Definition: PgsqlSqlUtil.qm.dox.h:638
constructor(string n, *hash c, *string ts)
creates the object with the given attributes
PgsqlColumn memberGate(string k)
returns the PgsqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
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
constructor()
creates an empty primary key object
PostgreSQL savepoint helper.
Definition: PgsqlSqlUtil.qm.dox.h:310
createSavepointImpl()
Creates the savepoint.
constructor(AbstractDatasource ds, *string savepoint)
Creates the object.
rollbackImpl()
Rolls back to the savepoint.
deleteSavepointImpl()
Deletes the savepoint.
class for PostgreSQL sequences
Definition: PgsqlSqlUtil.qm.dox.h:682
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the sequence in the database
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
provides the PostgreSQL-specific implementation of the SqlUtil::AbstractTable interface
Definition: PgsqlSqlUtil.qm.dox.h:1122
hash getColumnOperatorMapImpl()
returns the column operator map for this object
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
const PgsqlCopMap
column operator specializations for PostgreSQL
Definition: PgsqlSqlUtil.qm.dox.h:1326
bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
doSelectLimitOnlyUnlockedImpl(reference< hash< QueryInfo > > info, reference< string > sql)
processes a string for use in SQL select statements when there is a "limit" argument,...
bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
int server_version_minor
PostgreSQL server minor version.
Definition: PgsqlSqlUtil.qm.dox.h:1437
const PgsqlIopMap
a hash of default value operator descriptions for PostgreSQL
Definition: PgsqlSqlUtil.qm.dox.h:1410
bool hasArrayBind()
returns False because the pgsql driver does not support array binds / bulk DML operations
bool has_atomic_merge
Set based on the postgreSQL server version.
Definition: PgsqlSqlUtil.qm.dox.h:1428
string schema
schema name for the table
Definition: PgsqlSqlUtil.qm.dox.h:1422
clearImpl()
clears PostgreSQL-specific table information
int server_version
PostgreSQL server full version code.
Definition: PgsqlSqlUtil.qm.dox.h:1431
bool hasAtomicUpsert()
Returns True if the server supports atomic upsert/merge operations.
list< auto > getColumnSqlNames(softlist< auto > cols)
returns a list of column names for use in SQL strings
*string getTablespaceName()
returns the data tablespace name for the table or NOTHING if none is known
int server_version_major
PostgreSQL server major version.
Definition: PgsqlSqlUtil.qm.dox.h:1434
AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
getServerVersion()
Sets the internal PostgreSQL server version.
hash< auto > getExpressionMap()
Returns the expression map for PostgreSQL.
transient Mutex pg_state()
Lock for atomicity for setting state info.
copyImpl(AbstractTable old)
db-specific copy actions
bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
const QoreTypeMap
maps qore type names to PostgreSQL type names
Definition: PgsqlSqlUtil.qm.dox.h:1134
*string tablespace
tablespace name for the table, if known
Definition: PgsqlSqlUtil.qm.dox.h:1419
constructor(AbstractDatasource nds, string nname, *hash opts)
Creates the object from the arguments.
string getCreateTableSqlImpl(*hash opt)
returns a string that can be used to create the table in the database
const PgsqlExpressionMap
Expression map for PostgreSQL.
Definition: PgsqlSqlUtil.qm.dox.h:1156
bool supportsTablespacesImpl()
returns True if the database support tablespaces
string getCreateSqlImpl(list l)
returns a string that can be used to create the table in the database
string getSchemaName()
returns the schema name
const PgsqlNameMap
maps from verbose type names to simple type names
Definition: PgsqlSqlUtil.qm.dox.h:1130
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: PgsqlSqlUtil.qm.dox.h:1735
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...
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 getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
const PgsqlUopMap
a hash of default update operator definitions for PostgreSQL
Definition: PgsqlSqlUtil.qm.dox.h:1414
*string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
Functions triggerFunctions
contains any trigger functions supporting triggers on the table
Definition: PgsqlSqlUtil.qm.dox.h:1425
int server_version_sub
PostgreSQL server version.
Definition: PgsqlSqlUtil.qm.dox.h:1440
const PgsqlTruncDate
Map SqlUtil::cop_trunc_date() constants to PostgreSQL internal masks.
Definition: PgsqlSqlUtil.qm.dox.h:1406
const PgsqlTypeMap
maps PostgreSQL type names to type configurations
Definition: PgsqlSqlUtil.qm.dox.h:1126
hash getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
const PgsqlTableDescriptionHashOptions
extends SqlUtil::AbstractTable::TableDescriptionHashOptions with "functions"
Definition: PgsqlSqlUtil.qm.dox.h:1140
hash getInsertOperatorMap()
returns the insert operator map for this object
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifiers for schema,...
code getUpsertClosure(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure for performing upserts
represents a PostgreSQL-specific trigger function
Definition: PgsqlSqlUtil.qm.dox.h:797
string trigger
trigger name
Definition: PgsqlSqlUtil.qm.dox.h:801
represents a PostgreSQL-specific trigger
Definition: PgsqlSqlUtil.qm.dox.h:729
softlist getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the trigger in the database
softlist 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
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
softlist getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
represents a PostgreSQL type
Definition: PgsqlSqlUtil.qm.dox.h:337
string getDropSql(*hash opt)
returns a string that can be used to drop the function from the database
string getCreateSql(*hash opt)
returns a string that can be used to create the type in the database
string src
the source of the type
Definition: PgsqlSqlUtil.qm.dox.h:344
string name
the name of the type
Definition: PgsqlSqlUtil.qm.dox.h:341
constructor(string n_name, string n_src)
creates the type from the supplied arguments
string getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename a type
bool equal(PgsqlType type)
returns True if the types are equal
common base class for unique constraints
Definition: PgsqlSqlUtil.qm.dox.h:548
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: PgsqlSqlUtil.qm.dox.h:553
getIndexSql(reference< string > sql, string name, *hash opts)
adds index options onto the sql creation string
constructor(*string ts)
creates the constraint with an optional tablespace name
clearIndex()
clears any index base for the constraint
bool setIndexBase(string ix)
sets the supporting index name
class modeling a unique constraint
Definition: PgsqlSqlUtil.qm.dox.h:583
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 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
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: PgsqlSqlUtil.qm.dox.h:588
represents a PostgreSQL view
Definition: PgsqlSqlUtil.qm.dox.h:703
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
*string viewowner
Owner of the view.
Definition: PgsqlSqlUtil.qm.dox.h:707
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
transient AbstractDatasource ds
cache(*hash< auto > opts)
the PgsqlSqlUtil namespace contains all the objects in the PgsqlSqlUtil module
Definition: PgsqlSqlUtil.qm.dox.h:288
PgsqlDatabase get_database(AbstractDatasource nds, *hash< auto > opts)
returns a PgsqlDatabase object corresponding to the arguments
PgsqlTable get_table(AbstractDatasource nds, string nname, *hash< auto > opts)
returns a PgsqlTable object corresponding to the arguments