Qore PgsqlSqlUtil Module Reference  1.0
 All Classes Namespaces Functions Variables Groups Pages
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 2013 - 2014 Qore Technologies, sro
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 // this module requires Qore 0.8.8 or better
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
37  * 2013-10-04 v1.0: David Nichols <david@qore.org>
38  + the initial version of the PgsqlSqlUtil module
39 */
40 
192 namespace PgsqlSqlUtil {
195  PgsqlTable get_table(AbstractDatasource nds, string nname, *hash opts);
196 
197 
199  PgsqlDatabase get_database(AbstractDatasource nds, *hash opts);
200 
201 
202  parse_schema_name(string nname, reference schema, reference name);
203 
204 
206  class PgsqlType {
207 
208 public:
209  public :
211  string name;
212 
214  string src;
215 
216 public:
217 
218  constructor(string n_name, string n_src);
219 
220 
221  list getTypeList();
222 
223 
224  list getModifySql(PgsqlType old, *hash opt);
225 
226 
227  string getCreateSql(*hash opt);
228 
229 
230  string getDropSql(*hash opt);
231 
232 
233  string getRenameSql(string new_name);
234 
235 
236  bool equal(PgsqlType type);
237 
238  };
239 
242 
243 public:
244  public :
246  *string tablespace;
247 
248 public:
249 
251  constructor(string n_name, bool n_unique, hash n_cols, *string n_tablespace);
252 
253 
255  string getCreateSql(string table_name, *hash opt);
256 
257 
259  private bool equalImpl(AbstractIndex ix);
260 
261 
263  string getRenameSql(string table_name, string new_name);
264 
265  };
266 
269 
270 public:
271  constructor(string n, Columns c, ForeignConstraintTarget t);
272 
273 
274  string getCreateSql(string table_name, *hash opt);
275 
276 
277  softlist getRenameSql(string table_name, string new_name);
278 
279 
280  string getCreateSql(string name, string table_name, *hash opt);
281 
282  };
283 
286 
287 public:
288  constructor(string n, string n_src);
289 
290 
291  string getCreateSql(string table_name, *hash opt);
292 
293 
294  list getRenameSql(string table_name, string new_name);
295 
296 
297  string getCreateSql(string name, string table_name, *hash opt);
298 
299  };
300 
303 
304 public:
305  public :
308 
309 public:
310 
311  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs);
312 
313 
314  string getNativeTypeString();
315 
316 
318 
325  list getCreateSql(AbstractTable t);
326 
327 
329 
341  list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
342 
343 
345 
355  string getRenameSql(AbstractTable t, string new_name);
356 
357 
359  private bool equalImpl(AbstractColumn c);
360 
361  };
362 
365 
366 public:
367  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, softint n_scale);
368 
369 
370  string getNativeTypeString();
371 
372  };
373 
374 class PgsqlUniqueConstraintCommon : public SqlUtil::AbstractUniqueConstraint {
375 
376 public:
377  private :
379  *string tablespace;
380 
381 public:
382 
383  constructor(*string ts);
384 
385 
386  bool setIndexBase(string ix);
387 
388 
390  clearIndex();
391 
392 
393  abstract AbstractIterator keyIterator();
394 
396  getIndexSql(reference sql, string name, *hash opts);
397 
398  };
399 
400 class PgsqlUniqueConstraint : public SqlUtil::AbstractUniqueConstraint,public PgsqlUniqueConstraintCommon {
401 
402 public:
403  private :
405  bool enabled;
406 
407 public:
408 
409  constructor(string n, hash n_cols, bool e = True, *string ts);
410 
411 
413 
428  PgsqlColumn memberGate(string k);
429 
430 
431  string getCreateSql(string table_name, *hash opts);
432 
433 
434  list getRenameSql(string table_name, string new_name);
435 
436 
437  string getCreateSql(string name, string table_name, *hash opts);
438 
439  };
440 
442 class PgsqlPrimaryKey : public SqlUtil::AbstractPrimaryKey,public PgsqlUniqueConstraintCommon {
443 
444 public:
445  constructor();
446 
447 
448  constructor(string n, *hash c, *string ts);
449 
450 
452 
467  PgsqlColumn memberGate(string k);
468 
469 
470  string getCreateSql(string table_name, *hash opts);
471 
472 
473  softlist getRenameSql(string table_name, string new_name);
474 
475  };
476 
479 
480 public:
482  constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end);
483 
484 
486  string getCreateSql(*hash opt);
487 
488 
490  string getRenameSql(string new_name);
491 
492  };
493 
496 
497 public:
498 
499  public :
501  *string viewowner;
502 
503 public:
504 
506  constructor(string n_name, string n_src, *string n_schemaname,
507  *string n_viewowner)
508 ;
509 
510 
512  string getCreateSql(*hash opt);
513 
514 
516  softlist getRenameSql(string new_name);
517 
518  };
519 
522 
523 public:
525  constructor(string n, string n_src);
526 
527 
529  softlist getCreateSql(string table_name, *hash opt);
530 
531 
533  softlist getDropSql(string table_name);
534 
535 
537  private bool equalImpl(AbstractFunctionBase t);
538 
539 
541  softlist getRenameSql(string table_name, string new_name);
542 
543  };
544 
547 
548 public:
549  public :
550  *string args;
551 
552 public:
553 
554  constructor(string n, string n_src, *string a);
555 
556 
558  softlist getCreateSql(*hash opt);
559 
560 
562  string getDropSql();
563 
564 
566  private bool equalImpl(AbstractFunctionBase t);
567 
568 
570  softlist getRenameSql(string new_name);
571 
572 
574  setName(string new_name);
575 
576  };
577 
580 
581 public:
582  public :
584  string trigger;
585 
586 public:
587 
588  constructor(string n, string n_src, string n_trigger);
589 
590  };
591 
594 
595 public:
596  public :
598  const PgsqlSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + (
599  "types": Type::Hash,
600  "type_map": Type::Hash,
601  );
602 
603  const PGSQL_TempSavepoint = "qore_pgsql_tmp_savepoint";
604 
605 public:
606 
607  constructor(AbstractDatasource nds, *hash opts);
608 
609 
610  private list featuresImpl();
611 
612 
613  PgsqlType makeType(string name, string src, *hash opts);
614 
615 
616  *PgsqlType getType(string name);
617 
618 
619  private PgsqlSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash opts);
620 
621 
622  private *AbstractSequence getSequenceImpl(string name);
623 
624 
625  private *AbstractView getViewImpl(string name);
626 
627 
628  private PgsqlFunction makeFunctionImpl(string name, string src, *hash opts);
629 
630 
631  private PgsqlFunction makeProcedureImpl(string name, string src, *hash opts);
632 
633 
634  private *AbstractFunction getFunctionImpl(string name);
635 
636 
637  private AbstractFunction getProcedureImpl(string name);
638 
639 
640  static *string getFunctionArgs(string err, reference src);
641 
642  static PgsqlFunction processFunction(hash row, bool native_case);
643 
644  private list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
645 
646 
647  private list getAlignSqlImpl(hash schema_hash, *hash opt);
648 
649 
651  private list listTablesImpl();
652 
653 
655 
659  private list listFunctionsImpl();
660 
661 
663 
665  private list listProceduresImpl();
666 
667 
668  private list listSequencesImpl();
669 
670 
671  private list listViewsImpl();
672 
673 
674  private string getCreateSqlImpl(list l);
675 
676 
677  static string getCreateSql(list l);
678 
681 
682 
684  private softint getNextSequenceValueImpl(string name);
685 
686 
688  private bool supportsSequencesImpl();
689 
690 
692  private bool supportsTypesImpl();
693 
694 
696  private bool supportsPackagesImpl();
697 
698 
700  private any tryExecArgsImpl(string sql, *softlist args);
701 
702 
704  private any tryExecRawImpl(string sql, *softlist args);
705 
706 
708  static any tryExecArgs(AbstractDatasource ds, string sql, *softlist args);
709 
711  static any tryExecRaw(AbstractDatasource ds, string sql);
712  };
713 
716 
717 public:
718  public :
720  const PgsqlTypeMap = (
721  "numeric": ("qore": Type::Number, "size": SZ_NUM,),
722  "decimal": ("qore": Type::Number, "size": SZ_NUM,),
723  "money": ("qore": Type::Number,),
724  "smallint": ("qore": Type::Int,),
725  "integer": ("qore": Type::Int,),
726  "bigint": ("qore": Type::Int,),
727  "smallserial": ("qore": Type::Int,),
728  "serial": ("qore": Type::Int,),
729  "bigserial": ("qore": Type::Int,),
730  "real": ("qore": Type::Float,),
731  "double precision": ("qore": Type::Float,),
732  "oid": ("qore": Type::Number,),
733  "character": ("qore": Type::String, "size": SZ_MAND,),
734  "char": ("qore": Type::String, "size": SZ_MAND,),
735  "character varying": ("qore": Type::String, "size": SZ_MAND,),
736  "varchar": ("qore": Type::String, "size": SZ_MAND,),
737  "date": ("qore": Type::Date,),
738  "timestamp without time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6), "default_size": 6,),
739  "timestamp": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
740  "timestamp with time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
741  "time without time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
742  "time": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
743  "time with time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
744  "interval": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
745  "abstime": ("qore": Type::Date,),
746  "reltime": ("qore": Type::Date,),
747  "text": ("qore": Type::String,),
748  "bytea": ("qore": Type::Binary,),
749  "bit": ("qore": Type::Binary,),
750  "bit varying": ("qore": Type::Binary,),
751  "boolean": ("qore": Type::Boolean,),
752  "macaddr": ("qore": Type::String,),
753  "inet": ("qore": Type::String,),
754  "cidr": ("qore": Type::String,),
755  );
756 
758  const PgsqlNameMap = (
759  "character varying": "varchar",
760  "character": "char",
761  "timestamp without time zone": "timestamp",
762  "time without time zone": "time",
763  );
764 
766  const QoreTypeMap = (
767  "integer": "bigint",
768  "float": "double precision",
769  "number": "numeric",
770  "string": "varchar",
771  "date": "timestamp",
772  "binary": "bytea",
773  "bool": "boolean",
774  SqlUtil::CHAR: "char",
775  SqlUtil::CLOB: "text",
776  SqlUtil::BLOB: "bytea",
777  );
778 
780  const PgsqlTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions + (
781  "functions": Type::Hash,
782  );
783 
784  const PgsqlColumnDescOptions = AbstractTable::ColumnDescOptions;
785 
786  const PgsqlIndexOptions = AbstractTable::IndexOptions;
787 
788  const PgsqlConstraintOptions = AbstractTable::ConstraintOptions + PgsqlIndexOptions + (
789  "index": Type::String,
790  );
791 
792  const PgsqlTableCreationOptions = AbstractTable::TableCreationOptions + PgsqlConstraintOptions + (
793  "omit_trigger_functions": Type::Boolean,
794  );
795 
796  const PgsqlAlignTableOptions = AbstractTable::AlignTableOptions + PgsqlTableCreationOptions;
797 
800  COP_OVER: (
801  "argcolumn": True,
802  "argoptional": True,
803  "code": string (*string cve, *string arg) {
804  string sql = cve + " over (";
805  if (arg)
806  sql += sprintf("partition by %s", arg);
807  sql += ")";
808  return sql;
809  },
810  ),
811  COP_YEAR: (
812  "code": string (string arg1, any arg) {
813  return sprintf("to_char(%s, 'YYYY')", arg1);
814  }
815  ),
816  COP_YEAR_MONTH: (
817  "code": string (string arg1, any arg) {
818  return sprintf("to_char(%s, 'YYYY-MM')", arg1);
819  }
820  ),
821  COP_YEAR_DAY: (
822  "code": string (string arg1, any arg) {
823  return sprintf("to_char(%s, 'YYYY-MM-DD')", arg1);
824  }
825  ),
826  COP_YEAR_HOUR: (
827  "code": string (string arg1, any arg) {
828  return sprintf("to_char(%s, 'YYYY-MM-DD HH24')", arg1);
829  }
830  ),
831  );
832 
833 public:
834 
835  private :
837  *string tablespace;
838 
840  string schema;
841 
843  Functions triggerFunctions;
844 
845 public:
846 
847  constructor(AbstractDatasource nds, string nname, *hash opts);
848 
849 
851  string getSchemaName();
852 
853 
855  *string getTablespaceName();
856 
857 
858  PgsqlFunction addTriggerFunction(string tfname, string src, string trigger);
859 
860 
861  private PgsqlFunction addTriggerFunctionUnlocked(string tfname, string src, string trigger);
862 
863 
865  string getSqlName();
866 
867 
868  private hash getTableCreationOptions();
869 
870 
871  private hash getTableDescriptionHashOptions();
872 
873 
874  private hash getColumnDescOptions();
875 
876 
877  private hash getIndexOptions();
878 
879 
880  private hash getConstraintOptions();
881 
882 
883  private hash getAlignTableOptions();
884 
885 
887  private hash getColumnOperatorMap();
888 
889 
890  private bool checkExistenceImpl();
891 
892 
893  private Columns describeImpl();
894 
895 
896  private PgsqlPrimaryKey getPrimaryKeyImpl();
897 
898 
899  private Indexes getIndexesImpl();
900 
901 
902  private ForeignConstraints getForeignConstraintsImpl(*hash opts);
903 
904 
905  private Constraints getConstraintsImpl();
906 
907 
908  private Triggers getTriggersImpl();
909 
910 
911  private string getCreateTableSqlImpl(*hash opt);
912 
913 
914  private *list getCreateMiscSqlImpl(*hash opt, bool cache);
915 
916 
917  private *list getAlignSqlImpl(AbstractTable table, *hash opt);
918 
919 
920  private string getCreateSqlImpl(list l);
921 
922 
923  private string getRenameSqlImpl(string new_name);
924 
925 
926  private AbstractColumn addColumnImpl(string cname, hash opt, bool nullable = True);
927 
928 
929  private AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash ch, *hash opt);
930 
931 
932  private AbstractIndex addIndexImpl(string iname, bool enabled, hash ch, *hash opt);
933 
934 
935  private AbstractForeignConstraint addForeignConstraintImpl(string cname, hash ch, string table, hash tch, *hash opt);
936 
937 
938  private AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash opt);
939 
940 
941  private AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash ch, *hash opt);
942 
943 
944  private AbstractTrigger addTriggerImpl(string tname, string src, *hash opt);
945 
946 
947  private bool tryInsertImpl(string sql, hash row);
948 
949 
950  private hash getQoreTypeMapImpl();
951 
952 
953  private hash getTypeMapImpl();
954 
955 
957  private *string getSqlValueImpl(any v);
958 
959 
960  private bool emptyImpl();
961 
962 
964  private clearImpl();
965 
966 
967  private softlist getDropSqlImpl();
968 
969 
970  private setupTableImpl(hash desc, *hash opt);
971 
972 
974  private bool constraintsLinkedToIndexesImpl();
975 
976 
978  private bool uniqueIndexCreatesConstraintImpl();
979 
980 
982  private bool supportsTablespacesImpl();
983 
984 
986  private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh);
987 
988 
990  private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch);
991 
992 
994  private any tryExecArgsImpl(string sql, *softlist args);
995 
996 
998  private any tryExecRawImpl(string sql, *softlist args);
999 
1000 
1002  private copyImpl(AbstractTable old);
1003 
1004  };
1005 };
*string viewowner
Owner of the view.
Definition: PgsqlSqlUtil.qm.dox.h:501
const Date
private bool supportsPackagesImpl()
returns True if the database supports packages
*string getTablespaceName()
returns the data tablespace name for the table or NOTHING if none is known
const Hash
represents a PostgreSQL view
Definition: PgsqlSqlUtil.qm.dox.h:495
const String
private any tryExecArgsImpl(string sql, *softlist args)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
represents a PostgreSQL-specific check constraint
Definition: PgsqlSqlUtil.qm.dox.h:285
string sprintf(string fmt,...)
const DefaultCopMap
private list listProceduresImpl()
since PostgreSQL only supports functions, this method is identical to listFunctionsImpl() ...
provides the PostgreSQL-specific implementation of the AbstractDatabase interface ...
Definition: PgsqlSqlUtil.qm.dox.h:593
private bool supportsTablespacesImpl()
returns True if the database support tablespaces
private bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
string getRenameSql(string new_name)
returns a string that can be used to rename the sequence in the database
private bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
string getCreateSql(*hash opt)
returns a string that can be used to create the sequence in the database
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
represents a PostgreSQL-specific column
Definition: PgsqlSqlUtil.qm.dox.h:302
const PgsqlNameMap
maps from verbose type names to simple type names
Definition: PgsqlSqlUtil.qm.dox.h:758
private bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
const COP_OVER
represents a PostgreSQL-specific trigger
Definition: PgsqlSqlUtil.qm.dox.h:521
softlist getCreateSql(*hash opt)
returns a string that can be used to create the function in the database
setName(string new_name)
sets the new name of the function
represents a PostgreSQL type
Definition: PgsqlSqlUtil.qm.dox.h:206
private clearImpl()
clears PostgreSQL-specific table information
const True
private hash getColumnOperatorMap()
returns the column operator map for this object
const SZ_MAND
PgsqlColumn memberGate(string k)
returns the PgsqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception ...
const CHAR
string trigger
trigger name
Definition: PgsqlSqlUtil.qm.dox.h:584
private bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
static any tryExecArgs(AbstractDatasource ds, string sql, *softlist args)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
represents a PostgreSQL-specific index
Definition: PgsqlSqlUtil.qm.dox.h:241
const PgsqlTableDescriptionHashOptions
extends SqlUtil::AbstractTable::TableDescriptionHashOptions with &quot;functions&quot; for table functions requ...
Definition: PgsqlSqlUtil.qm.dox.h:780
number number(softnumber n)
const COP_YEAR_HOUR
represents a PostgreSQL-specific trigger function
Definition: PgsqlSqlUtil.qm.dox.h:579
private any tryExecArgsImpl(string sql, *softlist args)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
int byte_size
byte size of the column
Definition: PgsqlSqlUtil.qm.dox.h:307
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
*string tablespace
the tablespace name of the index
Definition: PgsqlSqlUtil.qm.dox.h:246
represents a PostgreSQL-specific numeric column
Definition: PgsqlSqlUtil.qm.dox.h:364
list list(...)
const Float
const QoreTypeMap
maps qore type names to postgresql type names
Definition: PgsqlSqlUtil.qm.dox.h:766
static any tryExecRaw(AbstractDatasource ds, string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
string getSchemaName()
returns the schema name
const Boolean
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifiers for schema, etc)
private any tryExecRawImpl(string sql, *softlist args)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
const SZ_NUM
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_end)
creates the object from the arguments
string name
the name of the type
Definition: PgsqlSqlUtil.qm.dox.h:211
softlist getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
softlist getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the trigger in the database
const Binary
private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh)
processes a string for use in SQL select statements when there is a &quot;limit&quot; argument, but no &quot;orderby&quot; or &quot;offset&quot; arguments
private bool supportsSequencesImpl()
returns True if the database supports sequences
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
const PgsqlTypeMap
maps postgresql type names to type configurations
Definition: PgsqlSqlUtil.qm.dox.h:720
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
const COP_YEAR_MONTH
private any tryExecRawImpl(string sql, *softlist args)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
Functions triggerFunctions
contains any trigger functions supporting triggers on the table
Definition: PgsqlSqlUtil.qm.dox.h:843
private *string getSqlValueImpl(any v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
const PgsqlSchemaDescriptionOptions
PostgreSQL-specific schema description keys.
Definition: PgsqlSqlUtil.qm.dox.h:598
const BLOB
private bool supportsTypesImpl()
returns True if the database supports named types
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
string type(any arg)
const CLOB
string src
the source of the type
Definition: PgsqlSqlUtil.qm.dox.h:214
represents a PostgreSQL-specific primary key constraint
Definition: PgsqlSqlUtil.qm.dox.h:442
string string(softstring str)
private bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
private bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
softlist getRenameSql(string new_name)
returns a string that can be used to rename the view in the database
const Int
private list listTablesImpl()
returns a list of string table names in the database
const COP_YEAR
*string tablespace
tablespace name for the table, if known
Definition: PgsqlSqlUtil.qm.dox.h:837
private softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
represents a PostgreSQL-specific foreign constraint
Definition: PgsqlSqlUtil.qm.dox.h:268
const COP_YEAR_DAY
constructor(string n_name, string n_src, *string n_schemaname, *string n_viewowner)
creates the object from the arguments
string getDropSql()
returns a string that can be used to drop the function from the database
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
constructor(string n_name, bool n_unique, hash n_cols, *string n_tablespace)
creates the object from the arguments
string schema
schema name for the table
Definition: PgsqlSqlUtil.qm.dox.h:840
hash hash(object obj)
const PgsqlCopMap
column operator specializations for PostgreSQL
Definition: PgsqlSqlUtil.qm.dox.h:799
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; if the col...
const SZ_OPT
private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch)
processes a string for use in SQL select statements when there is an &quot;order by&quot; and &quot;offset&quot; argument...
class for PostgreSQL sequences
Definition: PgsqlSqlUtil.qm.dox.h:478
PgsqlTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns a PgsqlTable object corresponding to the arguments
provides the PostgreSQL-specific implementation of the SqlUtil::AbstractTable interface ...
Definition: PgsqlSqlUtil.qm.dox.h:715
private hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
softlist getRenameSql(string new_name)
returns a string that can be used to rename the function in the database
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:546
private copyImpl(AbstractTable old)
db-specific copy actions
private list listFunctionsImpl()
returns a list of string function names in the database