sql-metadata 2.18.0__tar.gz → 2.19.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sql_metadata
3
- Version: 2.18.0
3
+ Version: 2.19.0
4
4
  Summary: Uses tokenized query returned by python-sqlparse and generates query metadata
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "sql_metadata"
3
- version = "2.18.0"
3
+ version = "2.19.0"
4
4
  license="MIT"
5
5
  description = "Uses tokenized query returned by python-sqlparse and generates query metadata"
6
6
  authors = ["Maciej Brencz <maciej.brencz@gmail.com>", "Radosław Drążkiewicz <collerek@gmail.com>"]
@@ -17,7 +17,7 @@ python = "^3.9"
17
17
  sqlparse = ">=0.4.1,<0.6.0"
18
18
 
19
19
  [tool.poetry.dev-dependencies]
20
- black = "^25.9"
20
+ black = "^25.11"
21
21
  coverage = {extras = ["toml"], version = "^7.10"}
22
22
  pylint = "^3.3.9"
23
23
  pytest = "^8.4.2"
@@ -33,6 +33,7 @@ TABLE_ADJUSTMENT_KEYWORDS = {
33
33
  "INTO",
34
34
  "UPDATE",
35
35
  "TABLE",
36
+ "IFNOTEXISTS",
36
37
  }
37
38
 
38
39
  # next statement beginning after with statement
@@ -1005,6 +1005,7 @@ class Parser: # pylint: disable=R0902
1005
1005
  and self._open_parentheses[-1].is_partition_clause_start
1006
1006
  )
1007
1007
  and not (token.normalized == "USING" and last_keyword == "SELECT")
1008
+ and not (token.normalized == "IFNOTEXISTS")
1008
1009
  ):
1009
1010
  last_keyword = token.normalized
1010
1011
  return last_keyword
@@ -262,7 +262,8 @@ class SQLToken: # pylint: disable=R0902, R0904
262
262
  (self.is_name or self.is_keyword)
263
263
  and self.last_keyword_normalized in TABLE_ADJUSTMENT_KEYWORDS
264
264
  and self.previous_token.normalized not in ["AS", "WITH"]
265
- and self.normalized not in ["AS", "SELECT", "IF", "SET", "WITH"]
265
+ and self.normalized
266
+ not in ["AS", "SELECT", "IF", "SET", "WITH", "IFNOTEXISTS"]
266
267
  )
267
268
 
268
269
  @property
@@ -288,7 +289,7 @@ class SQLToken: # pylint: disable=R0902, R0904
288
289
  is_alias_without_as = (
289
290
  self.previous_token.normalized != self.last_keyword_normalized
290
291
  and not self.previous_token.is_punctuation
291
- and not self.previous_token.normalized == "EXISTS"
292
+ and not self.previous_token.normalized == "IFNOTEXISTS"
292
293
  )
293
294
  return is_alias_without_as or self.previous_token.is_right_parenthesis
294
295
 
File without changes
File without changes