Describe the use case
SqlAlchemy supports adding dialect kwargs for foreign keys, as does op.create_foreign_key(), but the renderer for ops.CreateForeignKeyOp does not pass through dialect_kwargs. An example of this is postgresql_not_valid.
Databases / Backends / Drivers targeted
postgres
Example Use
ALTER TABLE t1 ADD CONSTRAINT i FOREIGN KEY(c1) REFERENCES t2 (c2) NOT VALID;
Additional context
This was quite confusing, as it is documented as if it is handled, and it dialect_kwargs seem to be passed through for other constraints, just not for foreign keys. I have already begun working on the solution here.
Have a nice day!
Describe the use case
SqlAlchemy supports adding dialect kwargs for foreign keys, as does
op.create_foreign_key(), but the renderer forops.CreateForeignKeyOpdoes not pass throughdialect_kwargs. An example of this ispostgresql_not_valid.Databases / Backends / Drivers targeted
postgres
Example Use
ALTER TABLE t1 ADD CONSTRAINT i FOREIGN KEY(c1) REFERENCES t2 (c2) NOT VALID;Additional context
This was quite confusing, as it is documented as if it is handled, and it
dialect_kwargsseem to be passed through for other constraints, just not for foreign keys. I have already begun working on the solution here.Have a nice day!