Qore MssqlSqlUtilBase Module Reference 1.0
Loading...
Searching...
No Matches
MssqlSqlUtilBase.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* MssqlSqlUtilBase.qm Copyright (C) 2015 - 2024 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 required Qore version
26
27// requires the SqlUtil module
28
29// requires the Util module
30
31// don't use "$" signs for variables and class members, assume local variable scope
32
33// require type definitions everywhere
34
35// enable all warnings
36
37
154 MssqlTable get_table(AbstractDatasource nds, string nname, *hash<auto> opts);
155
156
158 MssqlDatabase get_database(AbstractDatasource nds, *hash<auto> opts);
159
160
161parse_schema_name(string nname, reference<string> schema, reference<string> name, string default_schema = 'dbo');
162
163
165class MssqlSavepointHelper : public AbstractSavepointHelper {
166
167public:
169
173 constructor(AbstractDatasource ds, *string savepoint = 'x' + get_random_string(31)) ;
174
175
177protected:
179public:
180
181
183protected:
185public:
186
187
189protected:
191public:
192
193};
194
197
198public:
200 constructor(string native_type, bool nullable, *hash<auto> options) ;
201
202};
203
206
207public:
209 *string filegroup;
210
212 constructor(string n_name, bool n_unique, hash n_cols, *string n_filegroup) ;
213
214
216 string getCreateSql(string table_name, *hash opt);
217
218
220protected:
221 bool equalImpl(AbstractIndex ix);
222public:
223
224
226 string getRenameSql(string table_name, string new_name);
227
228};
229
232
233public:
235 constructor(string n, Columns c, ForeignConstraintTarget t) ;
236
237
239 string getCreateSql(string table_name, *hash opt);
240
241
242 softlist getRenameSql(string table_name, string new_name);
243
244
246 string getCreateSql(string name, string table_name, *hash opt);
247
248};
249
252
253public:
255 constructor(string n, string n_src) ;
256
257
259 string getCreateSql(string table_name, *hash opt);
260
261
262 list getRenameSql(string table_name, string new_name);
263
264
266 string getCreateSql(string name, string table_name, *hash opt);
267
268};
269
272
273public:
276
278protected:
280public:
281
282
284 constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, *int scale) ;
285
286
288
295 softlist getAddColumnSql(AbstractTable t);
296
297
299
312 list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
313
314
316
326 string getRenameSql(AbstractTable t, string new_name);
327
328
330
332 string getDdlName(string name);
333
334
336protected:
337 bool equalImpl(AbstractColumn c);
338public:
339
340};
341
344
345public:
347 constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, softint scale) ;
348
349};
350
353
354public:
355protected:
357 *string filegroup;
358
359public:
360
362protected:
364public:
365
366
368 constructor(*string ts);
369
370
372 *string getTablespace();
373
374
376 setTablespace(*string ts);
377
378
380 bool setIndexBase(string ix);
381
382
385
386
388 getIndexSql(reference<string> sql, string name, *hash opts);
389
390};
391
394
395public:
396protected:
399
400public:
401
403
408 constructor(string n, hash n_cols, bool e = True, *string ts) ;
409
410
412
428
429
431 string getCreateSql(string table_name, *hash opts);
432
433
434 list getRenameSql(string table_name, string new_name);
435
436
438 string getCreateSql(string name, string table_name, *hash opts);
439
440
442 bool isEnabled();
443
444};
445
448
449public:
452
453
455
459 constructor(string n, *hash c, *string ts) ;
460
461
463
479
480
482 string getCreateSql(string table_name, *hash opts);
483
484
486 softlist getRenameSql(string table_name, string new_name);
487
488};
489
492
493public:
495 constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end) ;
496
497
499 string getCreateSql(*hash opt);
500
501
503
507 softlist getRenameSql(string new_name, *hash opt);
508
509};
510
513
514public:
516 constructor(string n_name, string n_src, *string n_schemaname) ;
517
518
520 string getCreateSql(*hash opt);
521
522
524
528 softlist getRenameSql(string new_name, *hash opt);
529
530};
531
534
535public:
537 constructor(string n, string n_src) ;
538
539
541 softlist getCreateSql(string table_name, *hash opt);
542
543
545 softlist getDropSql(string table_name);
546
547
549protected:
550 bool equalImpl(AbstractFunctionBase t);
551public:
552
553
555 softlist getRenameSql(string table_name, string new_name);
556
557};
558
561
562public:
563 *string args;
564
565 constructor(string n, string n_src, *string a) ;
566
567
569 softlist getCreateSql(*hash opt);
570
571
573
575 string getDropSql(*hash opt);
576
577
579protected:
580 bool equalImpl(AbstractFunctionBase t);
581public:
582
583
585
588 softlist getRenameSql(string new_name, *hash opt);
589
590
592 setName(string new_name);
593
594};
595
598
599public:
602
604 string default_schema = "dbo";
605
607 const MssqlSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions;
608
609 const mssql_TempSavepoint = "qore_mssql_tmp_savepoint";
610
613
616
617
619 const MaxPrecision = 38;
620
621 constructor(AbstractDatasource nds, *hash opts) ;
622
623
625
630
631
633
638
639
640protected:
641 list<string> featuresImpl();
642public:
643
644
645protected:
646 MssqlSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash opts);
647public:
648
649
650protected:
651 *AbstractSequence getSequenceImpl(string name);
652public:
653
654
655protected:
656 *AbstractView getViewImpl(string name);
657public:
658
659
660protected:
661 MssqlFunction makeFunctionImpl(string name, string src, *hash opts);
662public:
663
664
665protected:
666 MssqlFunction makeProcedureImpl(string name, string src, *hash opts);
667public:
668
669
670protected:
671 *AbstractFunction getFunctionImpl(string name);
672public:
673
674
675protected:
676 AbstractFunction getProcedureImpl(string name);
677public:
678
679
680protected:
681 list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
682public:
683
684
685protected:
686 list getAlignSqlImpl(hash schema_hash, *hash opt);
687public:
688
689
691protected:
692 softlist<string> listTablesImpl();
693public:
694
695
697
701protected:
702 list<string> listFunctionsImpl();
703public:
704
705
707
709protected:
710 list<string> listProceduresImpl();
711public:
712
713
714protected:
715 list<string> listSequencesImpl();
716public:
717
718
719protected:
720 list<string> listViewsImpl();
721public:
722
723
725protected:
726 string getCreateSqlImpl(list l);
727public:
728
729
731 static bool isSybase(AbstractDatasource ds);
732
734 static string getCreateSql(list l);
735
737protected:
739public:
740
741
743protected:
745public:
746
747
749protected:
750 softint getNextSequenceValueImpl(string name);
751public:
752
753
755protected:
756 softint getCurrentSequenceValueImpl(string name);
757public:
758
759
761protected:
763public:
764
765
767protected:
769public:
770
771
773protected:
775public:
776
777
779protected:
780 bool rebuildIndexImpl(string name, *hash options);
781public:
782
783
785protected:
786 computeStatisticsImpl(*hash options);
787public:
788
789
791protected:
792 reclaimSpaceImpl(*hash options);
793public:
794
795
797protected:
799public:
800
801
803protected:
804 auto tryExecArgsImpl(string sql, *softlist<auto> args);
805public:
806
807
809protected:
810 auto tryExecRawImpl(string sql, *softlist<auto> args);
811public:
812
813
815 static auto tryExecArgs(AbstractDatasource ds, string sql, *softlist<auto> args);
816
818 static auto tryExecRaw(AbstractDatasource ds, string sql);
819};
820
823
824public:
827
829 bool ss_has_merge = False;
830
832 bool ss_has_sequences = False;
833
835 const MssqlTypeMap = ...;
836
837
839 const QoreTypeMap = ...;
840
841
843 const MsQoreTypeMap = ...;
844
845
847 const SybaseQoreTypeMap = ...;
848
849
851 const MssqlTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions;
852
853 const MssqlColumnDescOptions = AbstractTable::ColumnDescOptions;
854
855 const MssqlIndexOptions = AbstractTable::IndexOptions;
856
857 const MssqlConstraintOptions = AbstractTable::ConstraintOptions + MssqlIndexOptions;
858
859 const MssqlTableCreationOptions = AbstractTable::TableCreationOptions + MssqlConstraintOptions;
860
861 const MssqlAlignTableOptions = AbstractTable::AlignTableOptions + MssqlTableCreationOptions;
862
865
866
869
870
873
874
876 const MssqlOpMap = ...;
877
878
880 const MssqlCopMap = ...;
881
882
884 /* Impl. note here. There is shorter workaround for this, but it does not work with seconds
885 and with dates older than 1.1.1970. (minutes will overflow later too etc.).
886 So no usage for: dateadd(ss, datediff(ss, 0, %s), 0) for example
887 */
888 const MssqlTruncDate = ...;
889
890
892 const MssqlIopMap = ...;
893
894
896 const MssqlUopMap = ...;
897
898
899protected:
901 *string filegroup;
902
904 string schema;
905
908
910 string default_schema = "dbo";
911
912public:
913
914 constructor(AbstractDatasource nds, string nname, *hash opts) ;
915
916
919
920
923
924
926
930 code getUpsertClosure(hash<auto> row, int upsert_strategy = UpsertAuto, *hash opt);
931
932
935
936
938 string getSqlName();
939
940
942 hash<auto> getExpressionMap();
943
944
947
948
949protected:
950 string getFromIntern(string from, *hash qh);
951public:
952
953
954protected:
955 hash getTableCreationOptions();
956public:
957
958
959protected:
960 hash getTableDescriptionHashOptions();
961public:
962
963
964protected:
965 hash getColumnDescOptions();
966public:
967
968
969protected:
970 hash getIndexOptions();
971public:
972
973
974protected:
975 hash getConstraintOptions();
976public:
977
978
979protected:
980 hash getAlignTableOptions();
981public:
982
983
985protected:
987public:
988
989
991protected:
993public:
994
995
997protected:
999public:
1000
1001
1003protected:
1005public:
1006
1007
1008protected:
1009 bool checkExistenceImpl();
1010public:
1011
1012
1013protected:
1014 Columns describeImpl();
1015public:
1016
1017
1018protected:
1019 Columns describeSybaseImpl();
1020public:
1021
1022
1023protected:
1024 Columns describeMssqlImpl();
1025public:
1026
1027
1028protected:
1029 MssqlPrimaryKey getPrimaryKeyImpl();
1030public:
1031
1032
1033protected:
1034 MssqlPrimaryKey getPrimaryKeySybaseImpl();
1035public:
1036
1037
1038protected:
1039 MssqlPrimaryKey getPrimaryKeyMssqlImpl();
1040public:
1041
1042
1043protected:
1044 Indexes getIndexesImpl();
1045public:
1046
1047
1048protected:
1049 Indexes getIndexesSybaseImpl();
1050public:
1051
1052
1053protected:
1054 Indexes getIndexesMssqlImpl();
1055public:
1056
1057
1058protected:
1059 ForeignConstraints getForeignConstraintsImpl(*hash opts);
1060public:
1061
1062
1063protected:
1064 ForeignConstraints getForeignConstraintsSybaseImpl();
1065public:
1066
1067
1068protected:
1069 ForeignConstraints getForeignConstraintsMssqlImpl();
1070public:
1071
1072
1073protected:
1074 Constraints getConstraintsImpl();
1075public:
1076
1077
1078protected:
1079 Constraints getConstraintsSybaseImpl();
1080public:
1081
1082
1083protected:
1084 Constraints getConstraintsMssqlImpl();
1085public:
1086
1087
1088protected:
1089 Triggers getTriggersImpl();
1090public:
1091
1092
1094protected:
1095 string getCreateTableSqlImpl(*hash opt);
1096public:
1097
1098
1099protected:
1100 *list getCreateMiscSqlImpl(*hash opt, bool cache);
1101public:
1102
1103
1104protected:
1105 *list getAlignSqlImpl(AbstractTable table, *hash opt);
1106public:
1107
1108
1110protected:
1111 string getCreateSqlImpl(list l);
1112public:
1113
1114
1115protected:
1116 string getRenameSqlImpl(string new_name);
1117public:
1118
1119
1120protected:
1121 AbstractColumn addColumnImpl(string cname, hash opt, bool nullable = True);
1122public:
1123
1124
1125protected:
1126 AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash ch, *hash opt);
1127public:
1128
1129
1130protected:
1131 AbstractIndex addIndexImpl(string iname, bool enabled, hash ch, *hash opt);
1132public:
1133
1134
1135protected:
1136 AbstractForeignConstraint addForeignConstraintImpl(string cname, hash ch, string table, hash tch, *hash opt);
1137public:
1138
1139
1140protected:
1141 AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash opt);
1142public:
1143
1144
1145protected:
1146 AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash ch, *hash opt);
1147public:
1148
1149
1150protected:
1151 AbstractTrigger addTriggerImpl(string tname, string src, *hash opt);
1152public:
1153
1154
1155protected:
1156 bool tryInsertImpl(string sql, hash<auto> row);
1157public:
1158
1159
1161
1163protected:
1164 bool isDuplicateRowErrorImpl(hash<ExceptionInfo> ex);
1165public:
1166
1167
1168protected:
1169 hash getQoreTypeMapImpl();
1170public:
1171
1172
1173protected:
1174 hash getTypeMapImpl();
1175public:
1176
1177
1179
1181protected:
1182 *string getSqlValueImpl(auto v);
1183public:
1184
1185
1187 string getColumnSqlName(string col);
1188
1189
1191 list getColumnSqlNames(softlist cols);
1192
1193
1194protected:
1195 bool emptyImpl();
1196public:
1197
1198
1200protected:
1202public:
1203
1204
1205protected:
1206 setupTableImpl(hash desc, *hash opt);
1207public:
1208
1209
1211protected:
1213public:
1214
1215
1217protected:
1219public:
1220
1221
1223protected:
1225public:
1226
1227
1229protected:
1230 doSelectLimitOnlyInternImpl(reference<hash<QueryInfo>> info, reference<string> sql);
1231public:
1232
1233
1235protected:
1236 doSelectOrderByWithOffsetSqlInternImpl(reference<hash<QueryInfo>> info, reference<string> sql, list<auto> coll);
1237public:
1238
1239
1241protected:
1242 auto tryExecArgsImpl(string sql, *softlist<auto> args);
1243public:
1244
1245
1247protected:
1248 auto tryExecRawImpl(string sql, *softlist<auto> args);
1249public:
1250
1251
1253protected:
1254 copyImpl(AbstractTable old);
1255public:
1256
1257
1258protected:
1259 *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
1260public:
1261
1262
1263protected:
1264 softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
1265public:
1266
1267
1269protected:
1270 AbstractDataProviderType getNumericTypeImpl(string native_type, bool nullable, *hash<auto> options);
1271public:
1272
1273
1275
1279protected:
1280 AbstractSavepointHelper getSavepointHelperImpl(*string savepoint);
1281public:
1282
1283};
1284};
represents a Mssql-specific check constraint
Definition MssqlSqlUtilBase.qm.dox.h:251
constructor(string n, string n_src)
creates the constraint from the supplied arguments
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
string getCreateSql(string name, string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
represents a Mssql-specific column
Definition MssqlSqlUtilBase.qm.dox.h:271
string getDdlName(string name)
returns the column name with quoting in case the column name is a reserved word
bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
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...
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
softlist getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
int byte_size
byte size of the column
Definition MssqlSqlUtilBase.qm.dox.h:275
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
constructor()
empty constructor for subclasses
provides the Mssql-specific implementation of the AbstractDatabase interface
Definition MssqlSqlUtilBase.qm.dox.h:597
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 > listFunctionsImpl()
returns a list of string function names in the database
bool requiresScale()
Returns True if the driver requires a scale to support decimal values in numeric or decimal columns.
static string getCreateSql(list l)
returns a string that can be used to create the schema in the database
const MssqlSchemaDescriptionOptions
Mssql-specific schema description keys.
Definition MssqlSqlUtilBase.qm.dox.h:607
string default_schema
default schema for user
Definition MssqlSqlUtilBase.qm.dox.h:604
const MssqlReservedWords
hash of reserved words
Definition MssqlSqlUtilBase.qm.dox.h:615
computeStatisticsImpl(*hash options)
compute statistics implementation. See SqlUtil::AbstractDatabase::computeStatistics()
int getMaximumPrecision()
Returns the maximum precision for numeric or decimal columns.
softlist< string > listTablesImpl()
returns a list of string table names in the database
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
reclaimSpaceImpl(*hash options)
reclaim space implementation. See SqlUtil::AbstractDatabase::reclaimSpace()
softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
bool supportsSequencesImpl()
returns True if the database supports sequences
bool rebuildIndexImpl(string name, *hash options)
rebuild index implementation. See SqlUtil::AbstractDatabase::rebuildIndex()
const MssqlReclaimSpaceOptions
Options for reclaimSpace()
Definition MssqlSqlUtilBase.qm.dox.h:612
hash getReclaimSpaceOptions()
returns driver-specific options to the base abstract class
string getCreateSqlImpl(list l)
returns a string that can be used to create the schema in the database
bool is_sybase
sybase flag
Definition MssqlSqlUtilBase.qm.dox.h:601
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
list< string > listProceduresImpl()
since Mssql only supports functions, this method is identical to listFunctionsImpl()
const MaxPrecision
Maximum precision.
Definition MssqlSqlUtilBase.qm.dox.h:619
hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
static bool isSybase(AbstractDatasource ds)
returns True if the DB is a Sybase 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
bool supportsPackagesImpl()
returns True if the database supports packages
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
represents a Mssql-specific foreign constraint
Definition MssqlSqlUtilBase.qm.dox.h:231
constructor(string n, Columns c, ForeignConstraintTarget t)
creates the constraint from the supplied arguments
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
string getCreateSql(string name, string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
represents a Mssql-specific function
Definition MssqlSqlUtilBase.qm.dox.h:560
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the function in the database
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
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
string getDropSql(*hash opt)
returns a string that can be used to drop the function from the database
represents a Mssql-specific index
Definition MssqlSqlUtilBase.qm.dox.h:205
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
*string filegroup
the tablespace (filegroup) name of the index
Definition MssqlSqlUtilBase.qm.dox.h:209
constructor(string n_name, bool n_unique, hash n_cols, *string n_filegroup)
creates the object from the arguments
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
the data type for Mssql DECIMAL columns
Definition MssqlSqlUtilBase.qm.dox.h:196
constructor(string native_type, bool nullable, *hash< auto > options)
creates the object
represents a Mssql-specific numeric column
Definition MssqlSqlUtilBase.qm.dox.h:343
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
represents a Mssql-specific primary key constraint
Definition MssqlSqlUtilBase.qm.dox.h:447
string getCreateSql(string table_name, *hash opts)
returns a string that can be used to create the constraint
constructor(string n, *hash c, *string ts)
creates the object with the given attributes
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the constraint
MssqlColumn memberGate(string k)
returns the MssqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
constructor()
creates an empty primary key object
Mssql savepoint helper.
Definition MssqlSqlUtilBase.qm.dox.h:165
deleteSavepointImpl()
Deletes the savepoint.
createSavepointImpl()
Creates the savepoint.
constructor(AbstractDatasource ds, *string savepoint='x'+get_random_string(31))
Creates the object.
rollbackImpl()
Rolls back to the savepoint.
class for Mssql sequences
Definition MssqlSqlUtilBase.qm.dox.h:491
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
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the sequence in the database
provides the Mssql-specific implementation of the SqlUtil::AbstractTable interface
Definition MssqlSqlUtilBase.qm.dox.h:822
hash getSelectOptions()
returns the select options for this driver
const QoreTypeMap
maps qore type names to DB type names
Definition MssqlSqlUtilBase.qm.dox.h:839
hash< auto > getWhereOperatorMap()
returns the "where" operator map for Mssql
bool supportsTablespacesImpl()
returns True if the database support tablespaces
copyImpl(AbstractTable old)
db-specific copy actions
const MssqlTruncDate
Map SqlUtil::cop_trunc_date() constants to Mssql internal masks.
Definition MssqlSqlUtilBase.qm.dox.h:888
hash getColumnOperatorMapImpl()
returns the column operator map for this object
const MssqlTableDescriptionHashOptions
equal to SqlUtil::AbstractTable::TableDescriptionHashOptions
Definition MssqlSqlUtilBase.qm.dox.h:851
list getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
*string getTablespaceName()
returns the data filegroup name for the table or NOTHING if none is known
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
Functions triggerFunctions
contains any trigger functions supporting triggers on the table
Definition MssqlSqlUtilBase.qm.dox.h:907
bool hasArrayBind()
returns False because the Mssql driver does not support array binds / bulk DML operations
bool is_sybase
sybase flag
Definition MssqlSqlUtilBase.qm.dox.h:826
const MssqlExpressionMap
Mssql Expression map.
Definition MssqlSqlUtilBase.qm.dox.h:872
const MssqlCopMap
column operator specializations for Mssql
Definition MssqlSqlUtilBase.qm.dox.h:880
code getUpsertClosure(hash< auto > row, int upsert_strategy=UpsertAuto, *hash opt)
returns a closure for performing upserts
bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
*string filegroup
filegroup name for the table, if known
Definition MssqlSqlUtilBase.qm.dox.h:901
*string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
const SybaseQoreTypeMap
maps qore type names to Sybase/SAP type names
Definition MssqlSqlUtilBase.qm.dox.h:847
bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
string getCreateTableSqlImpl(*hash opt)
returns a string that can be used to create the table in the database
bool ss_has_merge
"has merge" flag for SQL server
Definition MssqlSqlUtilBase.qm.dox.h:829
doSelectLimitOnlyInternImpl(reference< hash< QueryInfo > > info, reference< string > sql)
processes a string for use in SQL select statements with "limit" but no "orderby" or "offset"
const MssqlUopMap
a hash of default update operator definitions for Mssql
Definition MssqlSqlUtilBase.qm.dox.h:896
const MssqlOpMap
where operator specializations for Mssql
Definition MssqlSqlUtilBase.qm.dox.h:876
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 schema
schema name for the table
Definition MssqlSqlUtilBase.qm.dox.h:904
hash getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
const MsSqlServerTableHints
query hints
Definition MssqlSqlUtilBase.qm.dox.h:868
clearImpl()
clears Mssql-specific table information
hash< auto > getExpressionMap()
Returns the expression map for Mssql.
const MssqlIopMap
a hash of default value operator descriptions for Mssql
Definition MssqlSqlUtilBase.qm.dox.h:892
const MsQoreTypeMap
maps qore type names to MS SQL Server type names
Definition MssqlSqlUtilBase.qm.dox.h:843
AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
const MssqlSelectOptions
select options supported by MssqlSqlUtilBase
Definition MssqlSqlUtilBase.qm.dox.h:864
doSelectOrderByWithOffsetSqlInternImpl(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
string getCreateSqlImpl(list l)
returns a string that can be used to create the table in the database
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...
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
string getSchemaName()
returns the schema name
string default_schema
the default schema for the user
Definition MssqlSqlUtilBase.qm.dox.h:910
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,...
bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint with a unique index
bool ss_has_sequences
"has sequences" flag for SQL server
Definition MssqlSqlUtilBase.qm.dox.h:832
const MssqlTypeMap
maps postgresql type names to type configurations
Definition MssqlSqlUtilBase.qm.dox.h:835
represents a Mssql-specific trigger
Definition MssqlSqlUtilBase.qm.dox.h:533
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
softlist getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the trigger in the database
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
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
common base class for unique constraints
Definition MssqlSqlUtilBase.qm.dox.h:352
getIndexSql(reference< string > sql, string name, *hash opts)
adds index options onto the sql creation string
clearIndex()
clears any index base for the constraint
*string filegroup
any filegroup for the unique key index
Definition MssqlSqlUtilBase.qm.dox.h:357
constructor(*string ts)
creates the constraint with an optional filegroup name
constructor()
empty constructor for subclasses
setTablespace(*string ts)
sets or clears the filegroup name
bool setIndexBase(string ix)
sets the supporting index name
*string getTablespace()
returns the filegroup name used for this constraint, if known
class modeling a unique constraint
Definition MssqlSqlUtilBase.qm.dox.h:393
bool isEnabled()
returns True if the constraint is enabled, False if not
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 MssqlSqlUtilBase.qm.dox.h:398
string getCreateSql(string name, string table_name, *hash opts)
returns a string that can be used to rename the constraint
constructor(string n, hash n_cols, bool e=True, *string ts)
creates the object with the given attributes
MssqlColumn memberGate(string k)
returns the MssqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
represents a Mssql view
Definition MssqlSqlUtilBase.qm.dox.h:512
constructor(string n_name, string n_src, *string n_schemaname)
creates the object from the arguments
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the view in the database
transient AbstractDatasource ds
cache(*hash< auto > opts)
the MssqlSqlUtilBase namespace contains all the objects in the MssqlSqlUtilBase module
Definition MssqlSqlUtilBase.qm.dox.h:152
MssqlDatabase get_database(AbstractDatasource nds, *hash< auto > opts)
returns a MssqlDatabase object corresponding to the arguments
MssqlTable get_table(AbstractDatasource nds, string nname, *hash< auto > opts)
returns a MssqlTable object corresponding to the arguments