crate / crate-python

Python DB API client library for CrateDB, using HTTP.
https://cratedb.com/docs/python/
Apache License 2.0
78 stars 31 forks source link

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

Closed amotl closed 1 year ago

amotl commented 1 year ago

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 ^1, 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

amotl commented 1 year ago

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