Skip to content

Compiler: Make CREATE INDEX a no-op #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/sqlalchemy_cratedb/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,17 @@
)
return

def visit_create_index(self, create, **kw) -> str:
"""
CrateDB does not support `CREATE INDEX` statements.
"""
warnings.warn(

Check warning on line 207 in src/sqlalchemy_cratedb/compiler.py

View check run for this annotation

Codecov / codecov/patch

src/sqlalchemy_cratedb/compiler.py#L207

Added line #L207 was not covered by tests
"CrateDB does not support `CREATE INDEX` statements, "
"they will be omitted when generating DDL statements.",
stacklevel=2,
)
return "SELECT 1"

Check warning on line 212 in src/sqlalchemy_cratedb/compiler.py

View check run for this annotation

Codecov / codecov/patch

src/sqlalchemy_cratedb/compiler.py#L212

Added line #L212 was not covered by tests


class CrateTypeCompiler(compiler.GenericTypeCompiler):
def visit_string(self, type_, **kw):
Expand Down