Merged
Conversation
This handles better for BLOB type columns. Without this, it basically would have only worked for ASCII binary data since it gets Buffer.toString()'d, but then does an extra quoting and sanitization pass. For binary data, which we can assume is coming from a Buffer, we want to send as hexadecimal. Fixes #161
Member
Author
|
Ok, the fundamental issue with this solution is that I think we need to do something to deal with this as an ArrayBuffer or Uint8Array ? I'm not sure if we can feature-detect and allow |
81daa57 to
8d0ba85
Compare
mattrobenolt
commented
Jan 31, 2024
Member
Author
|
We should be able to add some trivial unit tests for this to confirm behavior. |
9f46615 to
0e46242
Compare
0e46242 to
de52a28
Compare
ayrton
reviewed
Feb 1, 2024
|
|
||
| export function cast(field: Field, value: string | null): any { | ||
| if (value === '' || value == null) { | ||
| if (value == null) { |
Contributor
There was a problem hiding this comment.
I think we want to handle empty strings when it's binary data and not just return an empty string
Member
Author
There was a problem hiding this comment.
I agree, see my comment below.
mattrobenolt
commented
Feb 1, 2024
|
|
||
| export function cast(field: Field, value: string | null): any { | ||
| if (value === '' || value == null) { | ||
| if (value == null) { |
Member
Author
There was a problem hiding this comment.
I agree, see my comment below.
ayrton
approved these changes
Feb 1, 2024
iheanyi
approved these changes
Feb 1, 2024
iheanyi
approved these changes
Feb 1, 2024
This was referenced Feb 1, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This handles better for BLOB type columns. Without this, it basically would have only worked for ASCII binary data since it gets Buffer.toString()'d, but then does an extra quoting and sanitization pass.
For binary data, which we can assume is coming from a Uint8Array, we want to send as hexadecimal.
Fixes #161