(self)
| 881 | ) |
| 882 | |
| 883 | def test_update_limit(self): |
| 884 | t = sql.table("t", sql.column("col1"), sql.column("col2")) |
| 885 | |
| 886 | self.assert_compile( |
| 887 | t.update().values({"col1": 123}), "UPDATE t SET col1=%s" |
| 888 | ) |
| 889 | self.assert_compile( |
| 890 | t.update() |
| 891 | .values({"col1": 123}) |
| 892 | .with_dialect_options(mysql_limit=5), |
| 893 | "UPDATE t SET col1=%s LIMIT 5", |
| 894 | ) |
| 895 | |
| 896 | # does not make sense but we want this to compile |
| 897 | self.assert_compile( |
| 898 | t.update() |
| 899 | .values({"col1": 123}) |
| 900 | .with_dialect_options(mysql_limit=0), |
| 901 | "UPDATE t SET col1=%s LIMIT 0", |
| 902 | ) |
| 903 | self.assert_compile( |
| 904 | t.update() |
| 905 | .values({"col1": 123}) |
| 906 | .with_dialect_options(mysql_limit=None), |
| 907 | "UPDATE t SET col1=%s", |
| 908 | ) |
| 909 | self.assert_compile( |
| 910 | t.update() |
| 911 | .where(t.c.col2 == 456) |
| 912 | .values({"col1": 123}) |
| 913 | .with_dialect_options(mysql_limit=1), |
| 914 | "UPDATE t SET col1=%s WHERE t.col2 = %s LIMIT 1", |
| 915 | ) |
| 916 | |
| 917 | def test_delete_limit(self): |
| 918 | t = sql.table("t", sql.column("col1"), sql.column("col2")) |
nothing calls this directly
no test coverage detected