sql-query-identifier icon indicating copy to clipboard operation
sql-query-identifier copied to clipboard

MySQL '#' syntax for inline comments isn't supported

Open mike183 opened this issue 3 years ago • 0 comments

Currently it seems that this package doesn't support using the # syntax for inline comments in MySQL.

Example Input

select 1;
# inline comment
select 2

Expected Output

[
  {
    start: 1,
    end: 9,
    text: 'select 1;',
    type: 'SELECT',
    executionType: 'LISTING',
    parameters: []
  },
  {
    start: 29,
    end: 37,
    text: 'select 2\n',
    type: 'SELECT',
    executionType: 'LISTING',
    parameters: []
  }
]

Actual Output (with strict mode disabled)

[
  {
    start: 1,
    end: 9,
    text: 'select 1;',
    type: 'SELECT',
    executionType: 'LISTING',
    parameters: []
  },
  {
    start: 11,
    end: 36,
    text: '# inline comment\nselect 2\n',
    type: 'UNKNOWN',
    executionType: 'UNKNOWN',
    parameters: []
  }
]

Demo Incase it's useful, I've also created a functioning demo here

mike183 avatar Nov 16 '22 12:11 mike183