sqlacodegen icon indicating copy to clipboard operation
sqlacodegen copied to clipboard

Add constraint naming convention configuration option

Open leonarduschen opened this issue 2 years ago • 5 comments

Closes #193

leonarduschen avatar Apr 24 '22 16:04 leonarduschen

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.

agronholm avatar Apr 26 '22 07:04 agronholm

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.

leonarduschen avatar Apr 26 '22 08:04 leonarduschen

Coverage Status

Coverage increased (+0.02%) to 99.744% when pulling f5016973bffd3c98708d46bf63071cb38a5cd4e2 on leonarduschen:add-constraint-naming into 5029eb12ebb41ea7978b8727f039e311b5cd4710 on agronholm:master.

coveralls avatar Apr 26 '22 09:04 coveralls

I've opened #200 to address the design choice of config file support which we probably need for this.

agronholm avatar Apr 26 '22 22:04 agronholm

I've addressed the 2 issues I mentioned earlier https://github.com/agronholm/sqlacodegen/issues/193#issuecomment-1109521217 - ready for review now

leonarduschen avatar Apr 27 '22 13:04 leonarduschen