Coverage for packages/sql-smith/src/sql_smith/capability/has_from.py: 77%
13 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 typing import Union
3from sql_smith.functions import identify_all, listing
6class HasFromMixin:
7 def from_(self, *tables: Union[str, "ExpressionInterface"]):
8 self._from = identify_all(*tables)
9 return self
11 def add_from(self, *tables: Union[str, "ExpressionInterface"]):
12 self._from = (*self._from, *identify_all(*tables))
13 return self
15 def _apply_from(self, query: "ExpressionInterface") -> "ExpressionInterface":
16 if self._from:
17 return query.append("FROM {}", listing(self._from))
18 return query