sqlacodegen
sqlacodegen copied to clipboard
Add constraint naming convention configuration option
Closes #193
FYI, I'm planning one last big refactoring before the final release (one which should resolve the issue of code duplication) and it will probably clash with this PR.
Right, I'm actually working on 2 additional issues, details outlined in https://github.com/agronholm/sqlacodegen/issues/193#issuecomment-1109521217
Those issues are only relevant when using these 2 types of tokens:
-
%(referred_column_0_name)s
,%(referred_column_0_N_name)s
,%(referred_column_0N_name)s
, etc -
%(constraint_name)s
I was thinking of doing everything in one go in this PR, but if you're going to do a big refactoring then perhaps I should just fix those in subsequent PRs? For now we can add a note in the docs that those tokens cannot be used.
Let me know what you think.
Coverage increased (+0.02%) to 99.744% when pulling f5016973bffd3c98708d46bf63071cb38a5cd4e2 on leonarduschen:add-constraint-naming into 5029eb12ebb41ea7978b8727f039e311b5cd4710 on agronholm:master.
I've opened #200 to address the design choice of config file support which we probably need for this.
I've addressed the 2 issues I mentioned earlier https://github.com/agronholm/sqlacodegen/issues/193#issuecomment-1109521217 - ready for review now