ydb-platform / ydb-sqlalchemy

YQL Dialect for SQLAlchemy
Apache License 2.0
21 stars 6 forks source link

Add support of DROP INDEX statement #54

Closed LuckySting closed 2 months ago

LuckySting commented 2 months ago

Problem

Now it is impossible to drop existed index:

index.drop(connection)

leads to exception:

Unexpected token \'DROP\' : cannot match to any predicted input...\n
SQL: 
DROP INDEX <index_name>

Proposed solution

Added an implementation of DROP INDEX to the dialect, so now it render query as:

ALTER TABLE <table> DROP INDEX <index>;

which is a YQL correct statement.