-
Notifications
You must be signed in to change notification settings - Fork 85
support specialized csv separator and delimiter #116
support specialized csv separator and delimiter #116
Conversation
Codecov Report
@@ Coverage Diff @@
## master #116 +/- ##
==========================================
- Coverage 51.92% 50.76% -1.17%
==========================================
Files 17 17
Lines 1770 1775 +5
==========================================
- Hits 919 901 -18
- Misses 782 811 +29
+ Partials 69 63 -6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
v4/export/sql_type.go
Outdated
@@ -153,11 +153,11 @@ func (r RowReceiverArr) WriteToBuffer(bf *bytes.Buffer, escapeBackslash bool) { | |||
bf.WriteByte(')') | |||
} | |||
|
|||
func (r RowReceiverArr) WriteToBufferInCsv(bf *bytes.Buffer, escapeBackslash bool, csvNullValue string) { | |||
func (r RowReceiverArr) WriteToBufferInCsv(bf *bytes.Buffer, escapeBackslash bool, opt csvOption) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass this by reference please (also all other occurrences)
func (r RowReceiverArr) WriteToBufferInCsv(bf *bytes.Buffer, escapeBackslash bool, opt csvOption) { | |
func (r RowReceiverArr) WriteToBufferInCsv(bf *bytes.Buffer, escapeBackslash bool, opt *csvOption) { |
"2;'female';'[email protected]';'020-1253';'healthy'\n" + | ||
"3;'male';'[email protected]';'020-1256';'healthy'\n" + | ||
"4;'female';'[email protected]';'020-1235';'healthy'\n" | ||
c.Assert(bf.String(), Equals, expected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please include a test case where separator has multiple characters and delimiter is "ma" (male
should become mamamalema
, femail
should become mafemamalema
, [email protected]
should become [email protected]
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 7eb9742
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
* support specialized csv separator and delimiter * address comments * address comment
* support specialized csv separator and delimiter * address comments * address comment
* support specialized csv separator and delimiter * address comments * address comment
* support specialized csv separator and delimiter * address comments * address comment
* support specialized csv separator and delimiter * address comments * address comment
What problem does this PR solve?
Resolve #113
What is changed and how it works?
Add arguments "csv-separator" and "csv-delimiter" to support specialized csv separator and delimiter.
Check List
Tests
Side effects
Related changes
Release note