Dialect: Add methods concerned with isolation levels as no-ops#217
Conversation
| def get_isolation_level_values(self, dbapi_conn): | ||
| return () | ||
|
|
||
| def set_isolation_level(self, dbapi_connection, level): | ||
| pass | ||
|
|
||
| def get_isolation_level(self, dbapi_connection): | ||
| return "NONE" |
There was a problem hiding this comment.
Any recommendations?
There was a problem hiding this comment.
Consulting Wikipedia and the SQLAlchemy documentation, READ UNCOMMITTED might be the right choice for CrateDB?
There was a problem hiding this comment.
Typical PostgreSQL drivers in Java (JDBC) and Python offer the same quartet, and Apache Spark additionally seems to provide NONE.
So, I guess using READ UNCOMMITTED as the default and single valid choice for CrateDB is the right way to resolve the situation?
There was a problem hiding this comment.
It looks like specifically for SQLAlchemy, AUTOCOMMIT seems to be more appropriate.
SQLAlchemy treats the concept of “autocommit” like any other isolation level; in that it is an isolation level that loses not only “read committed” but also loses atomicity. [...] This usually means that the typical DBAPI behavior of emitting
BEGINto the database automatically no longer occurs.
-- https://docs.sqlalchemy.org/en/20/core/connections.html#dbapi-autocommit
1bad06d to
b3896e3
Compare
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b3896e3 to
fc5c65a
Compare
fc5c65a to
9b19d3f
Compare
About
This was needed for unlocking mcp-alchemy, because it called
set_isolation_level()on the dialect instance.References