mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Removed unnecessary comments, refs #2354
This commit is contained in:
parent
d118d5c5bb
commit
64a125b860
1 changed files with 0 additions and 4 deletions
|
|
@ -1145,13 +1145,9 @@ def named_parameters(sql: str) -> List[str]:
|
|||
|
||||
e.g. for ``select * from foo where id=:id`` this would return ``["id"]``
|
||||
"""
|
||||
# Remove single-line comments
|
||||
sql = _single_line_comment_re.sub("", sql)
|
||||
# Remove multi-line comments
|
||||
sql = _multi_line_comment_re.sub("", sql)
|
||||
# Remove single-quoted strings
|
||||
sql = _single_quote_re.sub("", sql)
|
||||
# Remove double-quoted strings
|
||||
sql = _double_quote_re.sub("", sql)
|
||||
# Extract parameters from what is left
|
||||
return _named_param_re.findall(sql)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue