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

fix generate sql will be truncate when quote char in word #1402

Merged
merged 4 commits into from
Oct 26, 2024

Conversation

shanjuren
Copy link
Contributor

Some thesaurus`s word will be truncate when I use datafaker to generate SQL, like Address,Book... That reason is when SqlTransformer calling the handledObjectToString method will be one by one add char to new Object ,but if miss quote char will be stop.

Copy link

what-the-diff bot commented Oct 24, 2024

PR Summary

  • Revised String Construction Method
    Modified the method used to build strings in handledObjectToString. Transitioned from StringJoiner to StringBuilder, making the process more adaptable and efficient.
  • Streamlined Quote Handling
    Simplified how quotes within strings are managed, by eliminating the reliance on conditional check on joiner, enhancing the code's simplicity and readability.
  • Direct String Return
    Optimized the return process by directly returning the string that has been created with StringBuilder, promoting cleaner and more straightforward code.

asolntsev
asolntsev previously approved these changes Oct 24, 2024
Copy link
Collaborator

@asolntsev asolntsev left a comment

Choose a reason for hiding this comment

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

@shanjuren Could you please add a test? Probably in SqlTest.java

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.30%. Comparing base (848dfe7) to head (70fa616).
Report is 8 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1402      +/-   ##
============================================
+ Coverage     92.19%   92.30%   +0.11%     
- Complexity     3151     3153       +2     
============================================
  Files           319      319              
  Lines          6152     6149       -3     
  Branches        593      591       -2     
============================================
+ Hits           5672     5676       +4     
+ Misses          336      332       -4     
+ Partials        144      141       -3     

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

@shanjuren
Copy link
Contributor Author

@shanjuren Could you please add a test? Probably in SqlTest.java

OK,i will try do it

@shanjuren
Copy link
Contributor Author

is done

@bodiam
Copy link
Contributor

bodiam commented Oct 26, 2024

I fixed up the PR, I'll merge it in.

@bodiam bodiam merged commit 8260c40 into datafaker-net:main Oct 26, 2024
12 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.

4 participants