(self)
| 1075 | ) |
| 1076 | |
| 1077 | def test_legacy_delete_limit(self): |
| 1078 | t = sql.table("t", sql.column("col1"), sql.column("col2")) |
| 1079 | |
| 1080 | self.assert_compile(t.delete(), "DELETE FROM t") |
| 1081 | self.assert_compile( |
| 1082 | t.delete().with_dialect_options(mysql_limit=5), |
| 1083 | "DELETE FROM t LIMIT 5", |
| 1084 | ) |
| 1085 | # does not make sense but we want this to compile |
| 1086 | self.assert_compile( |
| 1087 | t.delete().with_dialect_options(mysql_limit=0), |
| 1088 | "DELETE FROM t LIMIT 0", |
| 1089 | ) |
| 1090 | self.assert_compile( |
| 1091 | t.delete().with_dialect_options(mysql_limit=None), |
| 1092 | "DELETE FROM t", |
| 1093 | ) |
| 1094 | self.assert_compile( |
| 1095 | t.delete() |
| 1096 | .where(t.c.col2 == 456) |
| 1097 | .with_dialect_options(mysql_limit=1), |
| 1098 | "DELETE FROM t WHERE t.col2 = %s LIMIT 1", |
| 1099 | ) |
| 1100 | |
| 1101 | @testing.combinations((update,), (delete,)) |
| 1102 | def test_legacy_update_delete_limit_int_only(self, crud_fn): |
nothing calls this directly
no test coverage detected