MkPersistSettings option for preserve CamelCase style of composite keys#1421
Merged
parsonsmatt merged 7 commits intoyesodweb:masterfrom Aug 24, 2022
Merged
Conversation
parsonsmatt
approved these changes
Aug 24, 2022
Collaborator
parsonsmatt
left a comment
There was a problem hiding this comment.
Great, thank you!
A few notes on the version number. I think I can commit that myself and get this meged+released soon.
Comment on lines
+43
to
+62
| spec :: Spec | ||
| spec = describe "CompositeKeyStyleSpec" $ do | ||
| describe "mpsCamelCaseCompositeKeySelector is False" $ do | ||
| it "Should generate Legacy style key selectors" $ do | ||
| let key = CompanyUserLegacyStyleKey "cName" "uName" | ||
|
|
||
| constrFields (toConstr key) | ||
| `shouldBe` | ||
| [ "companyUserLegacyStyleKeycompanyName" | ||
| , "companyUserLegacyStyleKeyuserName" | ||
| ] | ||
| describe "mpsCamelCaseCompositeKeySelector is True" $ do | ||
| it "Should generate CamelCase style key selectors" $ do | ||
| let key = CompanyUserCamelStyleKey "cName" "uName" | ||
|
|
||
| constrFields (toConstr key) | ||
| `shouldBe` | ||
| [ "companyUserCamelStyleKeyCompanyName" | ||
| , "companyUserCamelStyleKeyUserName" | ||
| ] |
Comment on lines
+996
to
+1000
| -- ^ Should we generate composite key accessors in the correct CamelCase style. | ||
| -- | ||
| -- If the 'mpsCamelCaseCompositeKeySelector' value is set to 'False', | ||
| -- then the field part of the accessor starts with the lowercase. | ||
| -- This is a legacy style. |
Collaborator
There was a problem hiding this comment.
This doc comment is fantastic <3
Collaborator
|
released! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before submitting your PR, check that you've:
@sincedeclarations to the Haddockstylish-haskellon any changed files..editorconfigfile for details)After submitting your PR:
(unreleased)on the ChangelogIn accordance with the #1420 , this PR adds an additional field
mpsCamelCaseCompositeKeySelectorto theMkPersistSettings.This field can be used to determine whether the entity composite key selectors should continue to match the Legacy style (companyUserKeycompanyId) or match the CameCase style (companyUserKeyCompanyId).