qodalis-cli-server-plugin-data-explorer 1.0.0b25__tar.gz → 1.0.0b26__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.5
2
2
  Name: qodalis-cli-server-plugin-data-explorer
3
- Version: 1.0.0b25
3
+ Version: 1.0.0b26
4
4
  Summary: Data Explorer plugin for Qodalis CLI servers
5
5
  Project-URL: Homepage, https://github.com/qodalis-solutions/cli-server-python
6
6
  Project-URL: Repository, https://github.com/qodalis-solutions/cli-server-python
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "qodalis-cli-server-plugin-data-explorer"
7
- version = "1.0.0b25"
7
+ version = "1.0.0b26"
8
8
  description = "Data Explorer plugin for Qodalis CLI servers"
9
9
  readme = { text = "", content-type = "text/plain" }
10
10
  license = "MIT"
@@ -203,7 +203,9 @@ def _quoted_identifier(sql: str, i: int, close: str) -> tuple[str, int]:
203
203
 
204
204
  def tokenize_sql(sql: str, reading: SqlReading = SQL_READINGS[0]) -> list[SqlToken]:
205
205
  """Splits SQL into words, quoted identifiers and punctuation; comments and
206
- string literals are dropped, so keywords inside them do not count."""
206
+ string literals are dropped, so keywords inside them do not count. A ``"..."``
207
+ string (MySQL without ``ANSI_QUOTES``) stays a single name token, so it never
208
+ hides a keyword and still names what it quotes."""
207
209
  tokens: list[SqlToken] = []
208
210
  i, n = 0, len(sql)
209
211
  while i < n:
@@ -229,7 +231,15 @@ def tokenize_sql(sql: str, reading: SqlReading = SQL_READINGS[0]) -> list[SqlTok
229
231
  else:
230
232
  i = _skip_block_comment(sql, i, reading.nested_comments)
231
233
  continue
232
- if c == "'" or (c == '"' and reading.double_quoted_strings):
234
+ if c == '"' and reading.double_quoted_strings:
235
+ # A string here, but every other dialect reads a name, and a string cannot stand where a table
236
+ # or a column does: kept as that name, so FROM "Users" u WHERE ... still names the table
237
+ end = _skip_string(sql, i, c, reading.backslash_escapes)
238
+ name = sql[i + 1 : max(i + 1, end - 1)].replace('""', '"')
239
+ tokens.append(SqlToken("ident", name, name))
240
+ i = end
241
+ continue
242
+ if c == "'":
233
243
  i = _skip_string(sql, i, c, reading.backslash_escapes)
234
244
  continue
235
245
  if c == "$" and reading.dollar_quotes: