Skip to content

Feature request: support query type 'CREATE INDEX' #363

@LanDinh

Description

@LanDinh

When trying to parse queries of the type CREATE INDEX, the Parser fails. It seems like this is currently not supported!

Stacktrace from within sql-metadata:

  File "/code/backend/core/sawmill/.venv/lib/python3.10/site-packages/sql_metadata/parser.py", line 344, in tables
    with_names = self.with_names
  File "/code/backend/core/sawmill/.venv/lib/python3.10/site-packages/sql_metadata/parser.py", line 441, in with_names
    for token in self._not_parsed_tokens:
  File "/code/backend/core/sawmill/.venv/lib/python3.10/site-packages/sql_metadata/parser.py", line 626, in _not_parsed_tokens
    return [x for x in self.tokens if x.token_type is None]
  File "/code/backend/core/sawmill/.venv/lib/python3.10/site-packages/sql_metadata/parser.py", line 179, in tokens
    _ = self.query_type
  File "/code/backend/core/sawmill/.venv/lib/python3.10/site-packages/sql_metadata/parser.py", line 122, in query_type
    raise ValueError("Not supported query type!")

Example query:

CREATE INDEX "microservice_serviceregist_khaleesi_gate_id_a65c66ac" ON "microservice_serviceregistrykhaleesiservice" ("khaleesi_gate_id")

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions