Skip to content

parser.without_comments returns incorrect SQL for a multi-line SQL with a single-line comment -- #394

@the21st

Description

@the21st

Example:

from sql_metadata import Parser

sql = '''SELECT * -- comment
FROM table
  WHERE table.id = '123'
'''

parser = Parser(sql)
parser.without_comments

outputs the following:
'SELECT *'

sql-metadata version: 2.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions