You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

sql-metadata

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql-metadata - pypi Package Compare versions

Comparing version
2.11.0
to
2.12.0
+1
-1
PKG-INFO
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

[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