Coverage for packages/sql-smith/src/sql_smith/query/sql_server/delete_query.py: 50%
10 statements
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
1from sql_smith.functions import literal
2from sql_smith.query import DeleteQuery as BaseDeleteQuery
5class DeleteQuery(BaseDeleteQuery):
6 """Sql Server DeleteQuery to support LIMIT."""
8 def start_expression(self) -> "ExpressionInterface":
9 query = super().start_expression()
10 if self._limit is None:
11 return query
12 return query.append("TOP({})", literal(self._limit))
14 def _apply_limit(self, query: "ExpressionInterface") -> "ExpressionInterface":
15 return query