Open MJacred opened 1 month ago
You are correct. Indeed slash should be kept in the string value.
I won't be able to fix it anytime soon. In my usecase it's not an issue, only invalid Golang identifier was.
@starsep: The "/" in identifiers was already escaped by v0.0.6. Your PR only touched ParseEnumVals
, which is counterproductive. So the PR could be reverted, no?
That seems unlikely. I used sqlboiler (I think) v4.16.2 which would generate invalid Golang identifiers.
It's using strmangle v0.0.6: https://github.com/volatiletech/sqlboiler/blob/v4.16.2/go.mod#L32
If you can test that it works correctly in v0.0.6 then indeed revert sounds good.
This issue's description shows the actual result of running version v4.16.2 as well as the latest sqlboiler master (which includes your change). And I tested multiple times, using a real scenario. As far as I can tell, your change only affects the enum string value
@starsep, @stephenafamo: Replacing a "/" in the constant identifier is fine, but NOT in the actual string value, which is perfectly valid syntax, and necessary for some users.
cause: #15