Qore SchemaReverse Module Reference 1.1
Loading...
Searching...
No Matches
SchemaReverse.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* SchemaReverse.qm Copyright 2016 - 2023 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 FORANY 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.13 or better
26
27// requires the SqlUtil module
28
29// requires the Util module
30
31// requires the Qorize module
32
33
34
35
124namespace SchemaReverse {
125
127 const TYPE_TO_CLASS = ...;
128
129
131 const MULTI_TO_CLASS = ...;
132
133
135 const TEMPLATE = ...;
136
137
139
146
147public:
148protected:
149 AbstractDatasource m_ds;
150 Database m_db;
151 string m_name;
152
153public:
154
159 constructor(AbstractDatasource ds, string name);
160
161
163 AbstractDatasource datasource();
164
165
167 Database database();
168
169
171 string name();
172
173
175
178 abstract any toQore();
179
181
183 string toString();
184
185 }; // class AbstractReverseObject
186
189
190public:
194 constructor(AbstractDatasource ds, string name)
196 {
197 }
198
199 hash toQore();
200
201 }; // class SequenceReverse
202
204
207
208public:
212 constructor(AbstractDatasource ds, string mask = ".*")
213 : AbstractReverseObject(ds, mask)
214 {
215 }
216
217 hash toQore();
218
219 }; // class SequencesReverse
220
223
224public:
228 constructor(AbstractDatasource ds, string name)
230 {
231 }
232
233 hash toQore();
234
235 }; // class TypeReverse
236
239
240public:
244 constructor(AbstractDatasource ds, string mask = ".*")
245 : AbstractReverseObject(ds, mask)
246 {
247 }
248
249 hash toQore();
250
251 }; // class TypesReverse
252
255
256public:
260 constructor(AbstractDatasource ds, string name)
262 {
263 }
264
265 hash toQore();
266
267
268 any columnToQore(AbstractColumn c);
269
270
271 }; // class TableReverse
272
275
276public:
280 constructor(AbstractDatasource ds, string mask = ".*")
281 : AbstractReverseObject(ds, mask)
282 {
283 }
284
285 hash toQore();
286
287 }; // class TablesReverse
288
290
295
296public:
297protected:
298 string m_object_type;
299 string m_function_name;
300 hash<string, bool> m_ignored_keys;
301
302public:
303
310 constructor(string object_type,
311 AbstractDatasource ds,
312 string name,
313 string function_name,
314 softlist ignored_keys
315 )
317 {
318 m_object_type = object_type;
319 m_function_name = function_name;
320 // make a hash of keys to ignore for fast lookups (to similate a set)
321 m_ignored_keys = map {$1: True}, ignored_keys;
322 }
323
324 hash toQore();
325
326 }; // class CodeBaseReverse
327
329
334
335public:
336protected:
337 string m_object_type;
338 string m_function_name;
339
340public:
341
347 constructor(string object_type,
348 AbstractDatasource ds,
349 string mask,
350 string function_name,
351 )
352 : AbstractReverseObject(ds, mask)
353 {
354 if (!exists TYPE_TO_CLASS{object_type});
355
356 m_object_type = object_type;
357 m_function_name = function_name;
358 }
359
360 hash toQore();
361
362 }; // class CodeBaseReverse
363
366
367public:
371 constructor(AbstractDatasource ds, string name)
372 : CodeBaseReverse("view", ds, name, "getView", ("schema", "name", ))
373 {
374 }
375 }; // class ViewReverse
376
379
380public:
384 constructor(AbstractDatasource ds, string mask = ".*")
385 : CodesBaseReverse("view", ds, mask, "viewIterator")
386 {
387 }
388 }; // class ViewsReverse
389
392
393public:
397 constructor(AbstractDatasource ds, string name)
398 : CodeBaseReverse("mview", ds, name, "getMaterializedView", ("schema", "name", "type"))
399 {
400 }
401 }; // class MViewReverse
402
405
406public:
410 constructor(AbstractDatasource ds, string mask = ".*")
411 : CodesBaseReverse("mview", ds, mask, "materializedViewIterator")
412 {
413 }
414 }; // class MViewsReverse
415
418
419public:
423 constructor(AbstractDatasource ds, string name)
425 {
426 }
427
428 string toQore();
429
430 }; // class FunctionReverse
431
434
435public:
439 constructor(AbstractDatasource ds, string mask = ".*")
440 : CodesBaseReverse("function", ds, mask, "functionIterator")
441 {
442 }
443 }; // class FunctionsReverse
444
447
448public:
452 constructor(AbstractDatasource ds, string name)
454 {
455 }
456
457 string toQore();
458
459 }; // class ProcedureReverse
460
463
464public:
468 constructor(AbstractDatasource ds, string mask = ".*")
469 : CodesBaseReverse("procedure", ds, mask, "procedureIterator")
470 {
471 }
472 }; // class ProceduresReverse
473
476
477public:
481 constructor(AbstractDatasource ds, string name)
483 {
484 }
485
486 hash toQore();
487
488 }; // class ProcedureReverse
489
492
493public:
497 constructor(AbstractDatasource ds, string mask = ".*")
498 : CodesBaseReverse("package", ds, mask, "packageIterator")
499 {
500 }
501 }; // class ProceduresReverse
502
505
506public:
507protected:
508 AbstractDatasource m_ds;
509 string m_class_name;
510
511public:
512
516 constructor(AbstractDatasource ds, string class_name);
517
518
519 string toString();
520
521
522 }; // class SchemaReverse
523
525
531
532
533}; // namespace SchemaReverse
A basic class for all SchemaReverse DB object related classes.
Definition: SchemaReverse.qm.dox.h:145
abstract any toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
string toString()
Make a string with Qore code from a structure prepared by AbstractReverseObject::toQore().
constructor(AbstractDatasource ds, string name)
A basic class for all DB object classes which use SQL code as base of its content.
Definition: SchemaReverse.qm.dox.h:294
hash toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
constructor(string object_type, AbstractDatasource ds, string name, string function_name, softlist ignored_keys)
Definition: SchemaReverse.qm.dox.h:310
A basic class for all DB object classes which use SQL code as base of its content.
Definition: SchemaReverse.qm.dox.h:333
constructor(string object_type, AbstractDatasource ds, string mask, string function_name,)
Definition: SchemaReverse.qm.dox.h:347
hash toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
Structure dump of a function.
Definition: SchemaReverse.qm.dox.h:417
string toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
constructor(AbstractDatasource ds, string name)
Definition: SchemaReverse.qm.dox.h:423
Structure dump of functions.
Definition: SchemaReverse.qm.dox.h:433
constructor(AbstractDatasource ds, string mask=".*")
Definition: SchemaReverse.qm.dox.h:439
Structure dump of a materialized view or snapshot.
Definition: SchemaReverse.qm.dox.h:391
constructor(AbstractDatasource ds, string name)
Definition: SchemaReverse.qm.dox.h:397
Structure dump of materialized views or snapshots.
Definition: SchemaReverse.qm.dox.h:404
constructor(AbstractDatasource ds, string mask=".*")
Definition: SchemaReverse.qm.dox.h:410
Structure dump of a package.
Definition: SchemaReverse.qm.dox.h:475
hash toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
constructor(AbstractDatasource ds, string name)
Definition: SchemaReverse.qm.dox.h:481
Structure dump of packages.
Definition: SchemaReverse.qm.dox.h:491
constructor(AbstractDatasource ds, string mask=".*")
Definition: SchemaReverse.qm.dox.h:497
Structure dump of a procedure.
Definition: SchemaReverse.qm.dox.h:446
constructor(AbstractDatasource ds, string name)
Definition: SchemaReverse.qm.dox.h:452
string toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
Structure dump of procedures.
Definition: SchemaReverse.qm.dox.h:462
constructor(AbstractDatasource ds, string mask=".*")
Definition: SchemaReverse.qm.dox.h:468
constructor(AbstractDatasource ds, string class_name)
Structure dump of a sequence.
Definition: SchemaReverse.qm.dox.h:188
constructor(AbstractDatasource ds, string name)
Definition: SchemaReverse.qm.dox.h:194
hash toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
Structure dump of sequences.
Definition: SchemaReverse.qm.dox.h:206
constructor(AbstractDatasource ds, string mask=".*")
Definition: SchemaReverse.qm.dox.h:212
hash toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
Structure dump of a table.
Definition: SchemaReverse.qm.dox.h:254
hash toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
constructor(AbstractDatasource ds, string name)
Definition: SchemaReverse.qm.dox.h:260
Structure dump of tables.
Definition: SchemaReverse.qm.dox.h:274
hash toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
constructor(AbstractDatasource ds, string mask=".*")
Definition: SchemaReverse.qm.dox.h:280
Structure dump of a 'type' or 'named type'.
Definition: SchemaReverse.qm.dox.h:222
hash toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
constructor(AbstractDatasource ds, string name)
Definition: SchemaReverse.qm.dox.h:228
Structure dump of 'types' or 'named types'.
Definition: SchemaReverse.qm.dox.h:238
hash toQore()
Dedicated functionlity to get DB object info into the internal structure is done here.
constructor(AbstractDatasource ds, string mask=".*")
Definition: SchemaReverse.qm.dox.h:244
Structure dump of a view.
Definition: SchemaReverse.qm.dox.h:365
constructor(AbstractDatasource ds, string name)
Definition: SchemaReverse.qm.dox.h:371
Structure dump of views.
Definition: SchemaReverse.qm.dox.h:378
constructor(AbstractDatasource ds, string mask=".*")
Definition: SchemaReverse.qm.dox.h:384
this namespace contains all public definitions in the SchemaReverse module
Definition: SchemaReverse.qm.dox.h:124
const TEMPLATE
A template string for full schema used in SchemaReverse::SchemaReverse class.
Definition: SchemaReverse.qm.dox.h:135
const TYPE_TO_CLASS
A map translating simple DB object name into its class.
Definition: SchemaReverse.qm.dox.h:127
AbstractReverseObject get_object(string object_type)
An universal wrapper to get any of SchemaReverse::AbstractReverseObject instance.
const MULTI_TO_CLASS
A map translating multi DB objects name into its class.
Definition: SchemaReverse.qm.dox.h:131