Skip to content

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

Description

@mike183

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions