File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -348,6 +348,21 @@ def _get_limit_or_fetch(self, select):
348
348
else :
349
349
return select ._fetch_clause
350
350
351
+ def visit_delete (self , delete_stmt , ** kw ):
352
+ if not delete_stmt ._where_criteria and delete_stmt .table .foreign_keys :
353
+ # https://community.intersystems.com/post/sql-foreign-key-constraint-check-delete
354
+ table = delete_stmt .table
355
+ nocheck = False
356
+ for fk in table .foreign_keys :
357
+ nocheck = not fk .ondelete and fk .parent .table == table
358
+ if not nocheck :
359
+ break
360
+
361
+ if nocheck is True :
362
+ delete_stmt = delete_stmt .prefix_with ('%NOCHECK' , dialect = 'iris' )
363
+ text = super ().visit_delete (delete_stmt , ** kw )
364
+ return text
365
+
351
366
def visit_true (self , expr , ** kw ):
352
367
return "1"
353
368
Original file line number Diff line number Diff line change @@ -93,3 +93,36 @@ def binary_literals(self):
93
93
94
94
return exclusions .closed ()
95
95
96
+ @property
97
+ def foreign_key_constraint_option_reflection_ondelete (self ):
98
+ return exclusions .open ()
99
+
100
+ @property
101
+ def fk_constraint_option_reflection_ondelete_restrict (self ):
102
+ return exclusions .closed ()
103
+
104
+ @property
105
+ def fk_constraint_option_reflection_ondelete_noaction (self ):
106
+ return exclusions .open ()
107
+
108
+ @property
109
+ def foreign_key_constraint_option_reflection_onupdate (self ):
110
+ return exclusions .open ()
111
+
112
+ @property
113
+ def fk_constraint_option_reflection_onupdate_restrict (self ):
114
+ return exclusions .closed ()
115
+
116
+
117
+ @property
118
+ def precision_numerics_many_significant_digits (self ):
119
+ """target backend supports values with many digits on both sides,
120
+ such as 319438950232418390.273596, 87673.594069654243
121
+
122
+ """
123
+ return exclusions .closed ()
124
+
125
+ @property
126
+ def symbol_names_w_double_quote (self ):
127
+ """Target driver can create tables with a name like 'some " table'"""
128
+ return exclusions .closed ()
You can’t perform that action at this time.
0 commit comments