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: introduce util.SplitStatements #14

Merged
merged 1 commit into from
Mar 20, 2024
Merged

feat: introduce util.SplitStatements #14

merged 1 commit into from
Mar 20, 2024

Conversation

atzoum
Copy link
Collaborator

@atzoum atzoum commented Mar 13, 2024

Description

util.SplitStatements splits a string containing multiple sql statements separated by semicolons:

  • It strips out comments from the statements, both simple (--) and bracketed (/* */) ones.
  • It can handle sql strings properly, which may contain semi colons, escaped quotes and comment character sequences without affecting the splitting behaviour.

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@atzoum atzoum requested a review from kuldeep0020 March 13, 2024 14:31
@atzoum atzoum force-pushed the feat.splitStatements branch from 7cf9bfa to fa05849 Compare March 13, 2024 14:32
@atzoum
Copy link
Collaborator Author

atzoum commented Mar 13, 2024

@kuldeep0020 this function should be more than enough to replace that

@atzoum atzoum force-pushed the feat.splitStatements branch from fa05849 to 8911e89 Compare March 13, 2024 14:34
@atzoum atzoum requested a review from ruchiramoitra March 13, 2024 14:34
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.10%. Comparing base (b00a62e) to head (7f5c6f9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #14      +/-   ##
==========================================
+ Coverage   87.81%   88.10%   +0.29%     
==========================================
  Files          55       56       +1     
  Lines        2002     2052      +50     
==========================================
+ Hits         1758     1808      +50     
  Misses        170      170              
  Partials       74       74              

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

@atzoum atzoum force-pushed the feat.splitStatements branch from 8911e89 to b0693db Compare March 13, 2024 14:46
@atzoum atzoum marked this pull request as ready for review March 13, 2024 14:50
@atzoum atzoum force-pushed the feat.splitStatements branch from b0693db to faa7c0e Compare March 13, 2024 14:51
@atzoum atzoum force-pushed the feat.splitStatements branch 2 times, most recently from b162a60 to fc5252b Compare March 20, 2024 06:12
@atzoum atzoum force-pushed the feat.splitStatements branch from fc5252b to 7f5c6f9 Compare March 20, 2024 08:45
@atzoum atzoum merged commit 4039fcc into main Mar 20, 2024
18 checks passed
@atzoum atzoum deleted the feat.splitStatements branch March 20, 2024 16:18
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.

2 participants