Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
export statements #778
export statements #778
Changes from 11 commits
40a2ebe
4f1de35
208725a
334be96
7d8d914
0023c63
87c3177
b679283
b721d97
f69fe09
864e209
f96058f
8335ae4
de6c3c8
0750c08
51d2715
858301f
c29ea22
7d80374
47109f6
b6b076b
e2561ce
097b368
5ca86c8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Do we have some 3rd-party library for easier use? This logic may be the same when exporting slow queries.
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.
Make sense, let me have a check.
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.
Seems this lib can help us: https://github.com/oleiade/reflections , let me try it.
But it doesn't reduce much code, we need to extract it to a util method when we need to reuse it.
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.
This library implements an encrypted io.Reader / io.Writer, which could be a better choice. Maybe you can have a try: https://github.com/Xeoncross/go-aesctr-with-hmac
The encapsulation of the stream is file stream -> encrypted stream -> csv stream.
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.
Ok, thank you! let me have a look. Since I found zip the encrypted file won't reduce the size much, so I think it doesn't need to zip file in local, right? but to still zip it when sending data back to the client after being decrypted.
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.
IIRC, we use gzip already. Is there any further benefit of packaging as a zip for transmission?
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.
Make sense, let me focus on the encryption first.
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.
It works fine! and the final flow likes this: