(self)
| 915 | ) |
| 916 | |
| 917 | def test_delete_limit(self): |
| 918 | t = sql.table("t", sql.column("col1"), sql.column("col2")) |
| 919 | |
| 920 | self.assert_compile(t.delete(), "DELETE FROM t") |
| 921 | self.assert_compile( |
| 922 | t.delete().with_dialect_options(mysql_limit=5), |
| 923 | "DELETE FROM t LIMIT 5", |
| 924 | ) |
| 925 | # does not make sense but we want this to compile |
| 926 | self.assert_compile( |
| 927 | t.delete().with_dialect_options(mysql_limit=0), |
| 928 | "DELETE FROM t LIMIT 0", |
| 929 | ) |
| 930 | self.assert_compile( |
| 931 | t.delete().with_dialect_options(mysql_limit=None), |
| 932 | "DELETE FROM t", |
| 933 | ) |
| 934 | self.assert_compile( |
| 935 | t.delete() |
| 936 | .where(t.c.col2 == 456) |
| 937 | .with_dialect_options(mysql_limit=1), |
| 938 | "DELETE FROM t WHERE t.col2 = %s LIMIT 1", |
| 939 | ) |
| 940 | |
| 941 | @testing.combinations((update,), (delete,)) |
| 942 | def test_update_delete_limit_int_only(self, crud_fn): |
nothing calls this directly
no test coverage detected