Qore SqlUtil Module Reference  1.7.5
AbstractDatabase.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
25 namespace SqlUtil {
28 class AbstractDatabase : public AbstractSqlUtilBase {
29 
30 public:
32 
35  const DatabaseOptions = ...;
36 
37 
39 
42  const CacheOptions = ...;
43 
44 
46 
51  const CallbackOptions = ...;
52 
53 
62  const AC_Unchanged = 0;
64 
66  const AC_Create = 1;
67 
69  const AC_Drop = 2;
70 
72  const AC_Rename = 3;
73 
75  const AC_Modify = 4;
76 
78  const AC_Truncate = 5;
79 
81  const AC_Add = 6;
82 
84  const AC_Recreate = 7;
85 
87  const AC_Insert = 8;
88 
90  const AC_Update = 9;
91 
93  const AC_Delete = 10;
94 
96  const AC_NotFound = 11;
98 
100  const ActionMap = ...;
101 
102 
104  const ActionDescMap = ...;
105 
106 
108  const ActionLetterMap = ...;
109 
110 
112 
118  const CreationOptions = ...;
119 
120 
122 
125  const AlignSchemaOptions = ...;
126 
127 
129 
132  const DropSchemaOptions = ...;
133 
134 
136 
148  const SchemaDescriptionOptions = ...;
149 
150 
152 
157  const SequenceDescriptionOptions = ...;
158 
159 
161  const ComputeStatisticsOptions = ...;
162 
163 
165  const ReclaimSpaceOptions = ...;
166 
167 
168 protected:
170  bool native_case = False;
171 
172  // AbstractDatabase::getPhysicalSize() return in a case of no data
173  const GET_PHYSICAL_DB_SIZE_NOVAL = -1;
174 
175 public:
176 
178 
183 protected:
184  constructor(AbstractDatasource nds, *hash nopts) ;
185 public:
186 
187 
189  list features();
190 
191 
192  static doOkCallback(*hash<auto> opt, int ac, string type, string name, *string table, *string info);
193 
194 protected:
195  static runInfoCallback(code info_callback, int ac, string type, string name, *string table, *string new_name, *string info);
196 public:
197 
198 
199  static *string doCallback(*hash<auto> opt, *string sql, int ac, string type, string name, *string table, *string new_name, *string info);
200 
201  static list doCallback(*hash<auto> opt, list sql, int ac, string type, string name, *string table, *string new_name, *string info);
202 
204 
215  auto tryExec(string sql);
216 
217 
219 
229  auto tryExecArgs(string sql, *softlist<auto> args);
230 
231 
233 
244  auto tryExecRaw(string sql);
245 
246 
248 
262  list<auto> getAlignSql(hash schema_hash, *hash<auto> opt, *Tables table_cache);
263 
264 
266 
279  list<auto> getDropSchemaSql(hash schema_hash, *hash<auto> opt);
280 
281 
282 protected:
283  list dropSqlUnlocked(string type, hash schema_hash, code get, code make, *hash<auto> opt, string make_arg_type);
284 public:
285 
286 
287 protected:
288  list alignCodeUnlocked(string type, hash schema_hash, code get, code make, *hash<auto> opt, string make_arg_type);
289 public:
290 
291 
293 
309 AbstractSequence makeSequence(string name, number start = 1, number increment = 1, *softnumber end, *hash<auto> opts);
310 
311 
312  AbstractSequence makeSequenceFromDescription(string name, *hash<auto> sh, *hash<auto> opts);
313 
314 
316 
331  AbstractTable makeTable(string name, hash<auto> desc, *hash<auto> opts);
332 
333 
335 
350  AbstractFunction makeFunction(string name, string src, *hash<auto> opts);
351 
352 
354 
369  AbstractFunction makeProcedure(string name, string src, *hash<auto> opt);
370 
371 
373 
385  bool dropFunctionIfExists(string name, *hash<auto> opt);
386 
387 
389 
401  bool dropProcedureIfExists(string name, *hash<auto> opt);
402 
403 
405 
417  bool dropSequenceIfExists(string name, *hash<auto> opt);
418 
419 
421 
433  bool dropViewIfExists(string name, *hash<auto> opt);
434 
435 
437 
449  bool dropTableIfExists(string name, *hash<auto> opt);
450 
451 
453 
465  *string getDropFunctionSqlIfExists(string name, *hash<auto> opt);
466 
467 
469 
481  *string getDropProcedureSqlIfExists(string name, *hash<auto> opt);
482 
483 
485 
497  *string getDropSequenceSqlIfExists(string name, *hash<auto> opt);
498 
499 
501 
513  *list<auto> getDropTableSqlIfExists(string name, *hash<auto> opt);
514 
515 
516  doDropSql(*softlist l, string type, string name, *hash<auto> opt);
517 
518 
519  bool doDrop(*softlist l, string type, string name, *hash<auto> opt);
520 
521 
523 
535  list<auto> getAlignFunctionSql(AbstractFunction f, *hash<auto> opt);
536 
537 
539 
551  list<auto> getAlignProcedureSql(AbstractFunction f, *hash<auto> opt);
552 
553 
555 
564  *AbstractTable getTable(string name);
565 
566 
568 
577  *AbstractSequence getSequence(string name);
578 
579 
581 
592  *AbstractFunction getFunction(string name);
593 
594 
596 
607  *AbstractFunction getProcedure(string name);
608 
609 
611 
620  *AbstractView getView(string name);
621 
622 
624 
633  int getNextSequenceValue(string name);
634 
635 
637 
646  int getCurrentSequenceValue(string name);
647 
648 
650 
659  string getSqlFromList(list l);
660 
661 
663  bool supportsSequences();
664 
665 
667  bool supportsTypes();
668 
669 
671  bool supportsPackages();
672 
673 
675  list<string> listTables();
676 
677 
679  Qore::ListIterator tableIterator();
680 
681 
683  list<string> listFunctions();
684 
685 
687  Qore::ListIterator functionIterator();
688 
689 
691  list<string> listProcedures();
692 
693 
695  Qore::ListIterator procedureIterator();
696 
697 
699  list<string> listSequences();
700 
701 
703  Qore::ListIterator sequenceIterator();
704 
705 
707  list<string> listViews();
708 
709 
711  Qore::ListIterator viewIterator();
712 
713 
715 
725  bool rebuildIndex(string name, *hash<auto> options);
726 
727 
729 
737  bool rebuildIndex(AbstractIndex index, *hash<auto> options);
738 
739 
741 
748  computeStatistics(*hash<auto> options);
749 
750 
752 
759  reclaimSpace(*hash<auto> options);
760 
761 
763 
772  int getPhysicalSize();
773 
774 
776 
780  bool requiresScale();
781 
782 
784 
788  int getMaximumPrecision();
789 
790 
791 protected:
792  validateOptionsIntern(string err, hash<auto> ropt, reference<hash> opt);
793 public:
794 
795 
796 protected:
797  validateOptionsIntern(string err, hash<auto> ropt, reference<hash> opt, string tag);
798 public:
799 
800 
801  static AbstractDatabase getDatabase(AbstractDatasource nds, *hash<auto> opts);
802 
803  static AbstractDatabase getDatabase(string dsstr, *hash<auto> opts);
804 
805  static AbstractDatabase getDatabase(hash<auto> dsh, *hash<auto> opts);
806 
807  static checkDriverOptions(reference<hash> h, string drv);
808 
810 protected:
811  hash<auto> getDatabaseOptions();
812 public:
813 
814 
816 protected:
817  hash<auto> getCallbackOptions();
818 public:
819 
820 
822 protected:
823  hash<auto> getCreationOptions();
824 public:
825 
826 
828 protected:
829  hash<auto> getCacheOptions();
830 public:
831 
832 
834 protected:
835  hash<auto> getAlignSchemaOptions();
836 public:
837 
838 
840 protected:
841  hash<auto> getDropSchemaOptions();
842 public:
843 
844 
846 protected:
847  hash<auto> getSchemaDescriptionOptions();
848 public:
849 
850 
852 protected:
853  hash<auto> getSequenceDescriptionOptions();
854 public:
855 
856 
858 protected:
859  hash<auto> getRebuildIndexOptions();
860 public:
861 
862 
864 protected:
865  hash<auto> getComputeStatisticsOptions();
866 public:
867 
868 
870 protected:
871  hash<auto> getReclaimSpaceOptions();
872 public:
873 
874 
876 protected:
877  auto tryExecArgsImpl(string sql, *softlist<auto> args);
878 public:
879 
880 
882 protected:
883  auto tryExecRawImpl(string sql);
884 public:
885 
886 
887 protected:
888  abstract string getCreateSqlImpl(list l);
889 public:
890 protected:
891  abstract list<auto> getAlignSqlImpl(hash schema_hash, *hash<auto> opt);
892 public:
893 protected:
894  abstract list<auto> getDropSchemaSqlImpl(hash schema_hash, *hash<auto> opt);
895 public:
896 
897 protected:
898  abstract *AbstractSequence getSequenceImpl(string name);
899 public:
900 protected:
901  abstract *AbstractFunction getFunctionImpl(string name);
902 public:
903 protected:
904  abstract *AbstractFunction getProcedureImpl(string name);
905 public:
906 protected:
907  abstract *AbstractView getViewImpl(string name);
908 public:
909 
910 protected:
911  abstract AbstractSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash<auto> opts); abstract AbstractFunction makeFunctionImpl(string name, string src, *hash<auto> opts); abstract AbstractFunction makeProcedureImpl(string name, string src, *hash<auto> opts); abstract list<string> featuresImpl(); abstract list<string> listTablesImpl(); abstract list<string> listFunctionsImpl(); abstract list<string> listProceduresImpl(); abstract list<string> listSequencesImpl(); abstract list<string> listViewsImpl(); //! returns the next value in the given sequence abstract int getNextSequenceValueImpl(string name); #! returns the last value issued for the given sequence in the current session abstract int getCurrentSequenceValueImpl(string name); #! returns @ref True "True" if the database supports sequences abstract bool supportsSequencesImpl(); abstract bool supportsPackagesImpl(); abstract bool supportsTypesImpl(); abstract bool rebuildIndexImpl(string name, *hash<auto> options); abstract computeStatisticsImpl(*hash<auto> options); abstract reclaimSpaceImpl(*hash<auto> options); abstract int getPhysicalSizeImpl(); } }
number number(softnumber n)
const False
Qore AbstractNumericDataType class definition.
Definition: AbstractNumericDataType.qc.dox.h:31
int index(softstring str, softstring substr, softint pos=0)
list< auto > list(...)
string type(auto arg)
hash< auto > hash(object obj)