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 option use_sql_column_name_as_json_key #2910

Conversation

ValentinVignal
Copy link
Contributor

Should close #2847

@ValentinVignal
Copy link
Contributor Author

For the tests, I see you have an extras/integration_tests/ folder. Should I duplicate one of its sub folder and set the option to true ?

@simolus3
Copy link
Owner

simolus3 commented Mar 5, 2024

Thanks!

Should I duplicate one of its sub folder and set the option to true ?

We have a simpler way of testing all stages of the generator in a unit test. You can take a look at this test as inspiration, emulateDriftBuild takes a BuilderOptions instance to which you can pass a map with 'use_sql_column_name_as_json_key': true.

''')),
}, writer.dartOutputs, writer.writer);
},
tags: 'analyzer',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this tag, it was also in the test you suggested me to look at. Should I leave it?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it gives the test a little longer to run because the analyzer is sometimes a bit inconsistent in its timing.

Copy link
Owner

@simolus3 simolus3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now, thanks!

''')),
}, writer.dartOutputs, writer.writer);
},
tags: 'analyzer',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it gives the test a little longer to run because the analyzer is sometimes a bit inconsistent in its timing.

@simolus3 simolus3 merged commit 06852f0 into simolus3:develop Mar 6, 2024
10 checks passed
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.

DataClass toJson/fromJson with column names
2 participants