Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate camel caseing options #105

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

HoldYourWaffle
Copy link

I created separate options for camelCaseing type names and column names.

Use case: I wanted camelCased type names for aesthetic and readability reasons while keeping the structural integrate type checking provided by non-modified column names.

I have added tests accordingly. I had to add 2 type assertions in the cli integration test due to a strict undefined checking error, but since the test is skipped if the concerning variable is undefined this shouldn't cause any issues.

@cmmartti
Copy link

cmmartti commented Jun 12, 2019

I was just about to add this myself, for the same reasons you cited. For what it's worth, I checked your code and it all looks good.

Rather than adding two more options, did you consider overloading the existing camelCase option with columns and types string values? Like this:

export type OptionValues = {
    camelCase?: boolean | 'columns' | 'types';
    writeHeader?: boolean;
}

I think this shouldn't present any compatibility concerns, and it has a smaller API surface area.

@HoldYourWaffle
Copy link
Author

To be honest I didn't think about that, of course that's a way better solution (in my defense, it was very late...)
I have implemented this new system now.

evdhiggins added a commit to ever-ag/schemats that referenced this pull request Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants