Skip to content
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

SQLAlchemy: Improve DDL compiler to ignore unsupported UNIQUE and FOREIGN KEY constraints #582

Merged
merged 3 commits into from
Sep 28, 2023

Conversation

amotl
Copy link
Member

@amotl amotl commented Sep 28, 2023

About

Adjust SQLAlchemy's DDL compiler to ignore foreign key and uniqueness constraints, because CrateDB doesn't support them.

Background

At recent work about unlocking MLflow and LangChain to work together with CrateDB 12, we needed to add some patches/workarounds.

Both of those to be integrated here are pretty straight-forward and non-invasive, and just mask corresponding SQL features not supported by CrateDB anyway, in order run applications with typical data schemas. Other dialects essentially to the same on their corresponding weak spots.

P.S.: I am intending to bring in this patch before running another release, where users are currently waiting for.

/cc @hlcianfagna, @hammerhead, @surister

Footnotes

  1. https://github.com/crate-workbench/mlflow-cratedb

  2. https://github.com/crate-workbench/langchain

@amotl amotl requested review from seut, matriv and hlcianfagna and removed request for hlcianfagna September 28, 2023 13:32
@amotl amotl force-pushed the amo/sqlalchemy-improve-ddl-compiler branch from a72748b to ba624b3 Compare September 28, 2023 13:44
Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but how about logging some warning at least?
Additionally I think some NOTE entry in documentation is necessary to inform users as the DDLs would silently succeed and it's hidden from them that those features are unsupported.

@amotl
Copy link
Member Author

amotl commented Sep 28, 2023

Good idea. I added 154d77a, to emit corresponding warnings, as you suggested.

Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx! Since a msg is logged, I think it's enough.

@amotl amotl merged commit 47ad022 into master Sep 28, 2023
28 checks passed
@amotl amotl deleted the amo/sqlalchemy-improve-ddl-compiler branch September 28, 2023 14:43
@amotl amotl changed the title SQLAlchemy: Improve DDL compiler to ignore unsupported features SQLAlchemy: Improve DDL compiler to ignore unsupported UNIQUE and FOREIGN KEY constraints Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants