(self)
| 268 | ) |
| 269 | |
| 270 | def test_identifier(self): |
| 271 | expr_src = parse_one("SELECT a FROM tbl") |
| 272 | expr_tgt = parse_one("SELECT a, tbl.b from tbl") |
| 273 | |
| 274 | self._validate_delta_only( |
| 275 | diff_delta_only(expr_src, expr_tgt), |
| 276 | [ |
| 277 | Insert(expression=exp.to_column("tbl.b")), |
| 278 | ], |
| 279 | ) |
| 280 | |
| 281 | expr_src = parse_one("SELECT 1 AS c1, 2 AS c2") |
| 282 | expr_tgt = parse_one("SELECT 2 AS c1, 3 AS c2") |
| 283 | |
| 284 | self._validate_delta_only( |
| 285 | diff_delta_only(expr_src, expr_tgt), |
| 286 | [ |
| 287 | Remove(expression=exp.alias_(1, "c1")), |
| 288 | Remove(expression=exp.Literal.number(1)), |
| 289 | Insert(expression=exp.alias_(3, "c2")), |
| 290 | Insert(expression=exp.Literal.number(3)), |
| 291 | Update(source=exp.alias_(2, "c2"), target=exp.alias_(2, "c1")), |
| 292 | ], |
| 293 | ) |
| 294 | |
| 295 | def test_dialect_aware_diff(self): |
| 296 | from sqlglot.generator import logger |
nothing calls this directly
no test coverage detected