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

feat: add generator skip option for table columns #436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

galexrt
Copy link

@galexrt galexrt commented Dec 26, 2024

This is a quick implementation of having a skip option for table columns/fields in the generator for the feature request I created #435.
This might not be optimal but the easiest way I found to implement this feature.

Resolves #435

Copy link

codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.26%. Comparing base (f9ed359) to head (60ba05b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #436      +/-   ##
==========================================
+ Coverage   91.25%   91.26%   +0.01%     
==========================================
  Files         134      134              
  Lines        7755     7764       +9     
==========================================
+ Hits         7077     7086       +9     
  Misses        509      509              
  Partials      169      169              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@go-jet
Copy link
Owner

go-jet commented Jan 7, 2025

Hi @galexrt,
Yeah, it makes sense to have such a feature.
Not sure if it is intentional, with this change you're skipping only SQL builder columns, not model fields.
Could you also add a test here:

@galexrt galexrt force-pushed the skip_fields branch 6 times, most recently from 288587d to c36440d Compare January 7, 2025 21:25
@galexrt
Copy link
Author

galexrt commented Jan 7, 2025

I have added a test and due to it being easier to handle skipped fields for the column-list, I had added a template function columnList to render the list via strings.Join.

Please let me know if the combined test for model and sql builder is okay or should be split.

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.

Generator: Add option to Skip columns/fields
2 participants