Qore PgsqlSqlUtil Module Reference  1.2
PgsqlSqlUtil.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
2 // @file PgsqlSqlUtil.qm Qore user module for working with PostgreSQL SQL data
3 
4 /* PgsqlSqlUtil.qm Copyright (C) 2013 - 2017 Qore Technologies, s.r.o.
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 // minimum qore version
26 
27 // requires the SqlUtil module
28 
29 // don't use "$" signs for variables and class members, assume local variable scope
30 
31 // require type definitions everywhere
32 
33 // enable all warnings
34 
35 
36 // version history is included below in the docs
37 
211 namespace PgsqlSqlUtil {
214  PgsqlTable get_table(AbstractDatasource nds, string nname, *hash opts);
215 
216 
218  PgsqlDatabase get_database(AbstractDatasource nds, *hash opts);
219 
220 
221  parse_schema_name(string nname, reference<string> schema, reference<string> name);
222 
223 
225  class PgsqlType {
226 
227 public:
228  public :
230  string name;
231 
233  string src;
234 
235 public:
236 
238  constructor(string n_name, string n_src);
239 
240 
241  list getTypeList();
242 
243 
244  list getModifySql(PgsqlType old, *hash opt);
245 
246 
248  string getCreateSql(*hash opt);
249 
250 
252 
254  string getDropSql(*hash opt);
255 
256 
258 
261  string getRenameSql(string new_name, *hash opt);
262 
263 
265  bool equal(PgsqlType type);
266 
267  };
268 
271 
272 public:
273  public :
275  *string tablespace;
276 
277 public:
278 
280  constructor(string n_name, bool n_unique, hash n_cols, *string n_tablespace) ;
281 
282 
284  string getCreateSql(string table_name, *hash opt);
285 
286 
288 
289 private:
290  bool equalImpl(AbstractIndex ix);
291 public:
292 
293 
295  string getRenameSql(string table_name, string new_name);
296 
297 
298  };
299 
302 
303 public:
305  constructor(string n, Columns c, ForeignConstraintTarget t) ;
306 
307 
309  string getCreateSql(string table_name, *hash opt);
310 
311 
312  softlist getRenameSql(string table_name, string new_name);
313 
314 
316  string getCreateSql(string name, string table_name, *hash opt);
317 
318  };
319 
322 
323 public:
325  constructor(string n, string n_src) ;
326 
327 
329  string getCreateSql(string table_name, *hash opt);
330 
331 
332  list getRenameSql(string table_name, string new_name);
333 
334 
336  string getCreateSql(string name, string table_name, *hash opt);
337 
338  };
339 
342 
343 public:
344  public :
347 
348 public:
349 
351  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs) ;
352 
353 
355  string getNativeTypeString();
356 
357 
359 
366  list getAddColumnSql(AbstractTable t);
367 
368 
370 
383  list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
384 
385 
387 
397  string getRenameSql(AbstractTable t, string new_name);
398 
399 
401 
402 private:
403  bool equalImpl(AbstractColumn c);
404 public:
405 
406  };
407 
410 
411 public:
413  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, softint n_scale) ;
414 
415 
417  string getNativeTypeString();
418 
419  };
420 
423 
424 public:
425  private :
427  *string tablespace;
428 
429 public:
430 
432  constructor(*string ts);
433 
434 
436  *string getTablespace();
437 
438 
440  setTablespace(*string ts);
441 
442 
444  bool setIndexBase(string ix);
445 
446 
448  clearIndex();
449 
450 
452  abstract AbstractIterator keyIterator();
453 
455  getIndexSql(reference<string> sql, string name, *hash opts);
456 
457  };
458 
461 
462 public:
463  private :
465  bool enabled;
466 
467 public:
468 
470 
475  constructor(string n, hash n_cols, bool e = True, *string ts) ;
476 
477 
479 
494  PgsqlColumn memberGate(string k);
495 
496 
498  string getCreateSql(string table_name, *hash opts);
499 
500 
501  list getRenameSql(string table_name, string new_name);
502 
503 
505  string getCreateSql(string name, string table_name, *hash opts);
506 
507 
509  bool isEnabled();
510 
511  };
512 
515 
516 public:
518  constructor();
519 
520 
522 
526  constructor(string n, *hash c, *string ts) ;
527 
528 
530 
545  PgsqlColumn memberGate(string k);
546 
547 
549  string getCreateSql(string table_name, *hash opts);
550 
551 
553  softlist getRenameSql(string table_name, string new_name);
554 
555  };
556 
559 
560 public:
562  constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end) ;
563 
564 
566  string getCreateSql(*hash opt);
567 
568 
570 
574  softlist getRenameSql(string new_name, *hash opt);
575 
576  };
577 
580 
581 public:
582 
583  public :
585  *string viewowner;
586 
587 public:
588 
590  constructor(string n_name, string n_src, *string n_schemaname,
591  *string n_viewowner)
592  ;
593 
594 
596  string getCreateSql(*hash opt);
597 
598 
600 
604  softlist getRenameSql(string new_name, *hash opt);
605 
606  };
607 
610 
611 public:
613  constructor(string n, string n_src) ;
614 
615 
617  softlist getCreateSql(string table_name, *hash opt);
618 
619 
621  softlist getDropSql(string table_name);
622 
623 
625 
626 private:
627  bool equalImpl(AbstractFunctionBase t);
628 public:
629 
630 
632  softlist getRenameSql(string table_name, string new_name);
633 
634  };
635 
638 
639 public:
640  public :
641  *string args;
642 
643 public:
644 
645  constructor(string n, string n_src, *string a) ;
646 
647 
649  softlist getCreateSql(*hash opt);
650 
651 
653 
655  string getDropSql(*hash opt);
656 
657 
659 
660 private:
661  bool equalImpl(AbstractFunctionBase t);
662 public:
663 
664 
666 
669  softlist getRenameSql(string new_name, *hash opt);
670 
671 
673  setName(string new_name);
674 
675  };
676 
679 
680 public:
681  public :
683  string trigger;
684 
685 public:
686 
687  constructor(string n, string n_src, string n_trigger) ;
688 
689  };
690 
693 
694 public:
695  public :
697  const PgsqlSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + (
698  "types": Type::Hash,
699  "type_map": Type::Hash,
700  );
701 
702  const PGSQL_TempSavepoint = "qore_pgsql_tmp_savepoint";
703 
705  const PgsqlReclaimSpaceOptions = ReclaimSpaceOptions + (
706  "full" : Type::Boolean,
707  "analyze" : Type::Boolean,
708  );
709 
710 public:
711 
712  constructor(AbstractDatasource nds, *hash opts) ;
713 
714 
715 
716 private:
717  list featuresImpl();
718 public:
719 
720 
721  PgsqlType makeType(string name, string src, *hash opts);
722 
723 
724  *PgsqlType getType(string name);
725 
726 
727 
728 private:
729  PgsqlSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash opts);
730 public:
731 
732 
733 
734 private:
735  *AbstractSequence getSequenceImpl(string name);
736 public:
737 
738 
739 
740 private:
741  *AbstractView getViewImpl(string name);
742 public:
743 
744 
745 
746 private:
747  PgsqlFunction makeFunctionImpl(string name, string src, *hash opts);
748 public:
749 
750 
751 
752 private:
753  PgsqlFunction makeProcedureImpl(string name, string src, *hash opts);
754 public:
755 
756 
757 
758 private:
759  *AbstractFunction getFunctionImpl(string name);
760 public:
761 
762 
763 
764 private:
765  AbstractFunction getProcedureImpl(string name);
766 public:
767 
768 
769  static *string getFunctionArgs(string err, reference<string> src);
770 
771  static PgsqlFunction processFunction(hash row, bool native_case);
772 
773 
774 private:
775  list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
776 public:
777 
778 
779 
780 private:
781  list getAlignSqlImpl(hash schema_hash, *hash opt);
782 public:
783 
784 
786 
787 private:
788  list listTablesImpl();
789 public:
790 
791 
793 
798 private:
799  list listFunctionsImpl();
800 public:
801 
802 
804 
807 private:
808  list listProceduresImpl();
809 public:
810 
811 
812 
813 private:
814  list listSequencesImpl();
815 public:
816 
817 
818 
819 private:
820  list listViewsImpl();
821 public:
822 
823 
825  list listMaterializedViews();
826 
827 
829  ListIterator materializedViewIterator();
830 
831 
833  list listTypes();
834 
835 
837  ListIterator typeIterator();
838 
839 
841 
842 private:
843  string getCreateSqlImpl(list l);
844 public:
845 
846 
848  static string getCreateSql(list l);
849 
851 
852 private:
853  hash getSchemaDescriptionOptions();
854 public:
855 
856 
858 
859 private:
860  hash getReclaimSpaceOptions();
861 public:
862 
863 
865 
866 private:
867  softint getNextSequenceValueImpl(string name);
868 public:
869 
870 
872 
873 private:
874  softint getCurrentSequenceValueImpl(string name);
875 public:
876 
877 
879 
880 private:
881  bool supportsSequencesImpl();
882 public:
883 
884 
886 
887 private:
888  bool supportsTypesImpl();
889 public:
890 
891 
893 
894 private:
895  bool supportsPackagesImpl();
896 public:
897 
898 
900 
901 private:
902  bool rebuildIndexImpl(string name, *hash options);
903 public:
904 
905 
907 
908 private:
909  computeStatisticsImpl(*hash options);
910 public:
911 
912 
914 
915 private:
916  reclaimSpaceImpl(*hash options);
917 public:
918 
919 
921 
922 private:
923  auto tryExecArgsImpl(string sql, *softlist args);
924 public:
925 
926 
928 
929 private:
930  auto tryExecRawImpl(string sql, *softlist args);
931 public:
932 
933 
935  static auto tryExecArgs(AbstractDatasource ds, string sql, *softlist args);
936 
938  static auto tryExecRaw(AbstractDatasource ds, string sql);
939  };
940 
943 
944 public:
945  public :
947  const PgsqlTypeMap = (
948  "abstime": ("qore": Type::Date,),
949  "bigint": ("qore": Type::Int,),
950  "bigserial": ("qore": Type::Int,),
951  "bit": ("qore": Type::Binary, "size": SZ_OPT,),
952  "bit varying": ("qore": Type::Binary, "size": SZ_OPT,),
953  "bool": ("qore": Type::Boolean,),
954  "boolean": ("qore": Type::Boolean,),
955  "bytea": ("qore": Type::Binary,),
956  "char": ("qore": Type::String, "size": SZ_OPT,),
957  "character": ("qore": Type::String, "size": SZ_OPT,),
958  "character varying": ("qore": Type::String, "size": SZ_OPT,),
959  "cidr": ("qore": Type::String,),
960  "date": ("qore": Type::Date,),
961  "decimal": ("qore": Type::Number, "size": SZ_NUM,),
962  "double precision": ("qore": Type::Float,),
963  "float": ("qore": Type::Float,),
964  "inet": ("qore": Type::String,),
965  "int": ("qore": Type::Int,),
966  "integer": ("qore": Type::Int,),
967  "interval": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6), "default_size": 6,),
968  "macaddr": ("qore": Type::String,),
969  "money": ("qore": Type::Number,),
970  "numeric": ("qore": Type::Number, "size": SZ_NUM,),
971  "oid": ("qore": Type::Int,),
972  "real": ("qore": Type::Float,),
973  "reltime": ("qore": Type::Date,),
974  "serial": ("qore": Type::Int,),
975  "smallint": ("qore": Type::Int,),
976  "smallserial": ("qore": Type::Int,),
977  "text": ("qore": Type::String,),
978  "time": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6), "default_size": 6,),
979  "time with time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6), "default_size": 6,),
980  "time without time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6), "default_size": 6,),
981  "timetz": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6), "default_size": 6,),
982  "timestamp": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6), "default_size": 6,),
983  "timestamp with time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6), "default_size": 6,),
984  "timestamp without time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6), "default_size": 6,),
985  "timestamptz": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6), "default_size": 6,),
986  "varbit": ("qore": Type::Binary, "size": SZ_OPT,),
987  "varchar": ("qore": Type::String, "size": SZ_OPT,),
988  );
989 
991  const PgsqlNameMap = (
992  "bit varying": "varbit",
993  "character": "char",
994  "character varying": "varchar",
995  "char varying": "varchar",
996  "double precision": "float",
997  "time with time zone": "timetz",
998  "time without time zone": "time",
999  "timestamp with time zone": "timestamptz",
1000  "timestamp without time zone": "timestamp",
1001  );
1002 
1004  const QoreTypeMap = (
1005  "integer": "bigint",
1006  "float": "double precision",
1007  "number": "numeric",
1008  "string": "varchar",
1009  "date": "timestamp",
1010  "binary": "bytea",
1011  "bool": "boolean",
1012  SqlUtil::CHAR: "char",
1013  SqlUtil::CLOB: "text",
1014  SqlUtil::BLOB: "bytea",
1015  );
1016 
1018  const PgsqlTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions + (
1019  "functions": Type::Hash,
1020  );
1021 
1022  const PgsqlColumnDescOptions = AbstractTable::ColumnDescOptions;
1023 
1024  const PgsqlIndexOptions = AbstractTable::IndexOptions;
1025 
1026  const PgsqlConstraintOptions = AbstractTable::ConstraintOptions + PgsqlIndexOptions + (
1027  "index": Type::String,
1028  );
1029 
1030  const PgsqlTableCreationOptions = AbstractTable::TableCreationOptions + PgsqlConstraintOptions + (
1031  "omit_trigger_functions": Type::Boolean,
1032  );
1033 
1034  const PgsqlAlignTableOptions = AbstractTable::AlignTableOptions + PgsqlTableCreationOptions;
1035 
1037  const PgsqlCopMap = DefaultCopMap + (
1038  COP_CAST: (
1039  "code": string (string cve, list args) {
1040  string name = QoreTypeMap{args[0]} ?? args[0];
1041  hash desc = PgsqlTypeMap{name};
1042  string sql = sprintf ("cast (%s as %s", cve, name);
1043  switch (name);
1044 
1045  sql += ")";
1046  return sql;
1047  },
1048  ),
1049  COP_YEAR: (
1050  "code": string (string arg1, auto arg) {
1051  return sprintf("to_char(%s, 'YYYY')", arg1);
1052  }
1053  ),
1054  COP_YEAR_MONTH: (
1055  "code": string (string arg1, auto arg) {
1056  return sprintf("to_char(%s, 'YYYY-MM')", arg1);
1057  }
1058  ),
1059  COP_YEAR_DAY: (
1060  "code": string (string arg1, auto arg) {
1061  return sprintf("to_char(%s, 'YYYY-MM-DD')", arg1);
1062  }
1063  ),
1064  COP_YEAR_HOUR: (
1065  "code": string (string arg1, auto arg) {
1066  return sprintf("to_char(%s, 'YYYY-MM-DD HH24')", arg1);
1067  }
1068  ),
1069  COP_SEQ: (
1070  "nocolumn": True,
1071  "withalias": True,
1072  "code": string (*string cve, hash arg, reference<hash> psch) {
1073  string sql = sprintf("nextval('%s')", arg.seq);
1074  if (arg.as);
1075 
1076  return sql;
1077  }
1078  ),
1079  COP_SEQ_CURRVAL: (
1080  "nocolumn": True,
1081  "withalias": True,
1082  "code": string (*string cve, hash arg, reference<hash> psch) {
1083  string sql = sprintf("currval('%s')", arg.seq);
1084  if (arg.as);
1085 
1086  return sql;
1087  }
1088  ),
1089  COP_TRUNC_DATE: (
1090  "code": string sub(string arg1, auto arg) {
1091  if (!PgsqlTruncDate.hasKey(arg));
1092 
1093  return sprintf("date_trunc(%s, %s)", PgsqlTruncDate{arg}, arg1);
1094  }
1095  )
1096  );
1097 
1099  const PgsqlTruncDate = (
1100  DT_YEAR : "'year'",
1101  DT_MONTH : "'month'",
1102  DT_DAY : "'day'",
1103  DT_HOUR : "'hour'",
1104  DT_MINUTE : "'minute'",
1105  DT_SECOND : "'second'",
1106  );
1107 
1109  const PgsqlIopMap = DefaultIopMap + (
1110  IOP_SEQ: (
1111  "arg": Type::String,
1112  "placeholder": "nextval(%v)",
1113  ),
1114  IOP_SEQ_CURRVAL: (
1115  "arg": Type::String,
1116  "placeholder": "currval(%v)",
1117  ),
1118  );
1119 
1121  const PgsqlUopMap = DefaultUopMap + (
1122  COP_SEQ: (
1123  "nocolumn": True,
1124  "code": string (*string cve, string arg) {
1125  return sprintf("nextval('%s')", arg);
1126  }
1127  ),
1128  COP_SEQ_CURRVAL: (
1129  "nocolumn": True,
1130  "withalias": True,
1131  "code": string (*string cve, string arg) {
1132  return sprintf("currval('%s')", arg);
1133  }
1134  ),
1135  );
1136 
1137 public:
1138 
1139  private :
1141  *string tablespace;
1142 
1144  string schema;
1145 
1147  Functions triggerFunctions;
1148 
1149 public:
1150 
1151  constructor(AbstractDatasource nds, string nname, *hash opts) ;
1152 
1153 
1155  string getSchemaName();
1156 
1157 
1159  *string getTablespaceName();
1160 
1161 
1162  PgsqlFunction addTriggerFunction(string tfname, string src, string trigger);
1163 
1164 
1166  bool hasArrayBind();
1167 
1168 
1169 
1170 private:
1171  PgsqlFunction addTriggerFunctionUnlocked(string tfname, string src, string trigger);
1172 public:
1173 
1174 
1176  string getSqlName();
1177 
1178 
1179 
1180 private:
1181  hash getTableCreationOptions();
1182 public:
1183 
1184 
1185 
1186 private:
1187  hash getTableDescriptionHashOptions();
1188 public:
1189 
1190 
1191 
1192 private:
1193  hash getColumnDescOptions();
1194 public:
1195 
1196 
1197 
1198 private:
1199  hash getIndexOptions();
1200 public:
1201 
1202 
1203 
1204 private:
1205  hash getConstraintOptions();
1206 public:
1207 
1208 
1209 
1210 private:
1211  hash getAlignTableOptions();
1212 public:
1213 
1214 
1216 
1217 private:
1218  hash getColumnOperatorMap();
1219 public:
1220 
1221 
1223 
1224 private:
1225  hash getInsertOperatorMap();
1226 public:
1227 
1228 
1230 
1231 private:
1232  hash getRawUpdateOperatorMap();
1233 public:
1234 
1235 
1236 
1237 private:
1238  bool checkExistenceImpl();
1239 public:
1240 
1241 
1242 
1243 private:
1244  Columns describeImpl();
1245 public:
1246 
1247 
1248 
1249 private:
1250  PgsqlPrimaryKey getPrimaryKeyImpl();
1251 public:
1252 
1253 
1254 
1255 private:
1256  Indexes getIndexesImpl();
1257 public:
1258 
1259 
1260 
1261 private:
1262  ForeignConstraints getForeignConstraintsImpl(*hash opts);
1263 public:
1264 
1265 
1266 
1267 private:
1268  Constraints getConstraintsImpl();
1269 public:
1270 
1271 
1272 
1273 private:
1274  Triggers getTriggersImpl();
1275 public:
1276 
1277 
1279 
1280 private:
1281  string getCreateTableSqlImpl(*hash opt);
1282 public:
1283 
1284 
1285 
1286 private:
1287  *list getCreateMiscSqlImpl(*hash opt, bool cache);
1288 public:
1289 
1290 
1291 
1292 private:
1293  *list getAlignSqlImpl(AbstractTable table, *hash opt);
1294 public:
1295 
1296 
1298 
1299 private:
1300  string getCreateSqlImpl(list l);
1301 public:
1302 
1303 
1304 
1305 private:
1306  string getRenameSqlImpl(string new_name);
1307 public:
1308 
1309 
1310 
1311 private:
1312  AbstractColumn addColumnImpl(string cname, hash opt, bool nullable = True);
1313 public:
1314 
1315 
1316 
1317 private:
1318  AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash ch, *hash opt);
1319 public:
1320 
1321 
1322 
1323 private:
1324  AbstractIndex addIndexImpl(string iname, bool enabled, hash ch, *hash opt);
1325 public:
1326 
1327 
1328 
1329 private:
1330  AbstractForeignConstraint addForeignConstraintImpl(string cname, hash ch, string table, hash tch, *hash opt);
1331 public:
1332 
1333 
1334 
1335 private:
1336  AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash opt);
1337 public:
1338 
1339 
1340 
1341 private:
1342  AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash ch, *hash opt);
1343 public:
1344 
1345 
1346 
1347 private:
1348  AbstractTrigger addTriggerImpl(string tname, string src, *hash opt);
1349 public:
1350 
1351 
1352 
1353 private:
1354  bool tryInsertImpl(string sql, hash row);
1355 public:
1356 
1357 
1358 
1359 private:
1360  hash getQoreTypeMapImpl();
1361 public:
1362 
1363 
1364 
1365 private:
1366  hash getTypeMapImpl();
1367 public:
1368 
1369 
1371 
1372 private:
1373  *string getSqlValueImpl(auto v);
1374 public:
1375 
1376 
1377 
1378 private:
1379  bool emptyImpl();
1380 public:
1381 
1382 
1384 
1385 private:
1386  clearImpl();
1387 public:
1388 
1389 
1390 
1391 private:
1392  softlist getDropSqlImpl();
1393 public:
1394 
1395 
1396 
1397 private:
1398  setupTableImpl(hash desc, *hash opt);
1399 public:
1400 
1401 
1403 
1404 private:
1405  bool constraintsLinkedToIndexesImpl();
1406 public:
1407 
1408 
1410 
1411 private:
1412  bool uniqueIndexCreatesConstraintImpl();
1413 public:
1414 
1415 
1417 
1418 private:
1419  bool supportsTablespacesImpl();
1420 public:
1421 
1422 
1424 
1425 private:
1426  doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list> args, *hash qh);
1427 public:
1428 
1429 
1431 
1432 private:
1433  doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list> args, *hash qh, *hash jch, *hash ch, *hash psch, list coll);
1434 public:
1435 
1436 
1438 
1439 private:
1440  auto tryExecArgsImpl(string sql, *softlist args);
1441 public:
1442 
1443 
1445 
1446 private:
1447  auto tryExecRawImpl(string sql, *softlist args);
1448 public:
1449 
1450 
1452 
1453 private:
1454  copyImpl(AbstractTable old);
1455 public:
1456 
1457 
1458 
1459 private:
1460  *hash doReturningImpl(hash opt, reference<string> sql, list args);
1461 public:
1462 
1463 
1464 
1465 private:
1466  list getGroupOrderByListUnlocked(string key, hash qh, *hash jch, *hash ch, *hash psch, list coll);
1467 public:
1468 
1469  };
1470 };
*string viewowner
Owner of the view.
Definition: PgsqlSqlUtil.qm.dox.h:585
class modeling a unique constraint
Definition: PgsqlSqlUtil.qm.dox.h:460
const Date
const COP_SEQ
const Hash
represents a PostgreSQL view
Definition: PgsqlSqlUtil.qm.dox.h:579
const String
const DefaultIopMap
represents a PostgreSQL-specific check constraint
Definition: PgsqlSqlUtil.qm.dox.h:321
string sprintf(string fmt,...)
const DefaultCopMap
provides the PostgreSQL-specific implementation of the AbstractDatabase interface ...
Definition: PgsqlSqlUtil.qm.dox.h:692
the PgsqlSqlUtil namespace contains all the objects in the PgsqlSqlUtil module
Definition: PgsqlSqlUtil.qm.dox.h:212
represents a PostgreSQL-specific column
Definition: PgsqlSqlUtil.qm.dox.h:341
represents a PostgreSQL-specific trigger
Definition: PgsqlSqlUtil.qm.dox.h:609
represents a PostgreSQL type
Definition: PgsqlSqlUtil.qm.dox.h:225
const COP_SEQ_CURRVAL
const True
const CHAR
string trigger
trigger name
Definition: PgsqlSqlUtil.qm.dox.h:683
represents a PostgreSQL-specific index
Definition: PgsqlSqlUtil.qm.dox.h:270
number number(softnumber n)
const COP_YEAR_HOUR
represents a PostgreSQL-specific trigger function
Definition: PgsqlSqlUtil.qm.dox.h:678
const IOP_SEQ_CURRVAL
string getCreateSql(*hash opt)
returns a string that can be used to create the type in the database
int byte_size
byte size of the column
Definition: PgsqlSqlUtil.qm.dox.h:346
*string tablespace
the tablespace name of the index
Definition: PgsqlSqlUtil.qm.dox.h:275
represents a PostgreSQL-specific numeric column
Definition: PgsqlSqlUtil.qm.dox.h:409
list list(...)
const Float
const DT_DAY
const Boolean
string getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename a type
const SZ_NUM
string name
the name of the type
Definition: PgsqlSqlUtil.qm.dox.h:230
const Binary
bool enabled
True if the constraint is enabled, False if not
Definition: PgsqlSqlUtil.qm.dox.h:465
const COP_YEAR_MONTH
Functions triggerFunctions
contains any trigger functions supporting triggers on the table
Definition: PgsqlSqlUtil.qm.dox.h:1147
common base class for unique constraints
Definition: PgsqlSqlUtil.qm.dox.h:422
const BLOB
const CLOB
string src
the source of the type
Definition: PgsqlSqlUtil.qm.dox.h:233
represents a PostgreSQL-specific primary key constraint
Definition: PgsqlSqlUtil.qm.dox.h:514
constructor(string n_name, string n_src)
creates the type from the supplied arguments
string type(auto arg)
const COP_TRUNC_DATE
const Int
const COP_YEAR
string string(softstring str, *string enc)
*string tablespace
tablespace name for the table, if known
Definition: PgsqlSqlUtil.qm.dox.h:1141
represents a PostgreSQL-specific foreign constraint
Definition: PgsqlSqlUtil.qm.dox.h:301
const COP_CAST
const DT_MINUTE
const DT_HOUR
const DefaultUopMap
const COP_YEAR_DAY
const DT_MONTH
string getDropSql(*hash opt)
returns a string that can be used to drop the function from the database
string schema
schema name for the table
Definition: PgsqlSqlUtil.qm.dox.h:1144
hash hash(object obj)
const SZ_OPT
*string tablespace
any tablespace for the unique key index
Definition: PgsqlSqlUtil.qm.dox.h:427
class for PostgreSQL sequences
Definition: PgsqlSqlUtil.qm.dox.h:558
const IOP_SEQ
PgsqlTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns a PgsqlTable object corresponding to the arguments
const DT_YEAR
provides the PostgreSQL-specific implementation of the SqlUtil::AbstractTable interface ...
Definition: PgsqlSqlUtil.qm.dox.h:942
const Number
PgsqlDatabase get_database(AbstractDatasource nds, *hash opts)
returns a PgsqlDatabase object corresponding to the arguments
represents a PostgreSQL-specific function
Definition: PgsqlSqlUtil.qm.dox.h:637
bool equal(PgsqlType type)
returns True if the types are equal
const DT_SECOND