Closed bpercy11 closed 8 months ago
There's some related info in https://github.com/olirice/alembic_utils/issues/123 about redshift
simulate_entity
is highly reliant on savepoints/subtransactions for dependency resolution and exception handling. Unfortunately I don't think it feasible to remove that dependency.
if you're willing to forego dependency resolution entirely (your models don't depend on each other) might be able to strip out all the sub transaction stuff and just retain
but I'm not 100% on that
https://github.com/olirice/alembic_utils/blob/cf42ef81535670cd0e3c84111ae100a95c6b9205/src/alembic_utils/simulate.py#L17
I’m attempting to adapt alembic-utils to function with AWS Redshift. Aside from having to alter some of the queries against pg_* tables that don’t exist in redshift, an issue I have tried and failed to solve is converting the simulate.py’s simulate_entity() method to use session.begin() instead of session.begin_nested(). This is due to the fact that redshift does not have any implementation for SAVEPOINT which .begin_nested() uses which will throw errors when autogenerating materialized views via Alembic cli.
Having wrote the original method, could you help me in converting this?
Thank you!