sql-metadata
Advanced tools
+1
-1
| Metadata-Version: 2.1 | ||
| Name: sql_metadata | ||
| Version: 2.11.0 | ||
| Version: 2.12.0 | ||
| Summary: Uses tokenized query returned by python-sqlparse and generates query metadata | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/macbre/sql-metadata |
+3
-3
| [tool.poetry] | ||
| name = "sql_metadata" | ||
| version = "2.11.0" | ||
| version = "2.12.0" | ||
| license="MIT" | ||
@@ -22,4 +22,4 @@ description = "Uses tokenized query returned by python-sqlparse and generates query metadata" | ||
| coverage = {extras = ["toml"], version = "^6.5"} | ||
| pylint = "^3.1.0" | ||
| pytest = "^8.1.1" | ||
| pylint = "^3.2.3" | ||
| pytest = "^8.2.2" | ||
| pytest-cov = "^5.0.0" | ||
@@ -26,0 +26,0 @@ coveralls = "^3.3.1" |
@@ -111,2 +111,3 @@ """ | ||
| "DROPTABLE": QueryType.DROP, | ||
| "CREATEFUNCTION": QueryType.CREATE, | ||
| } | ||
@@ -113,0 +114,0 @@ |
@@ -117,3 +117,5 @@ # pylint: disable=C0302 | ||
| ) | ||
| if tokens[index].normalized in ["CREATE", "ALTER", "DROP"]: | ||
| if tokens[index].normalized == "CREATE": | ||
| switch = self._get_switch_by_create_query(tokens, index) | ||
| elif tokens[index].normalized in ("ALTER", "DROP"): | ||
| switch = tokens[index].normalized + tokens[index + 1].normalized | ||
@@ -1083,1 +1085,17 @@ else: | ||
| yield token | ||
| @staticmethod | ||
| def _get_switch_by_create_query(tokens: List[SQLToken], index: int) -> str: | ||
| """ | ||
| Return the switch that creates query type. | ||
| """ | ||
| switch = tokens[index].normalized + tokens[index + 1].normalized | ||
| # Hive CREATE FUNCTION | ||
| if any( | ||
| index + i < len(tokens) and tokens[index + i].normalized == "FUNCTION" | ||
| for i in (1, 2) | ||
| ): | ||
| switch = "CREATEFUNCTION" | ||
| return switch |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
91013
0.69%1755
0.92%