Conversation
|
@MarkHerhold bummer, I have bumped into that |
|
Fixes #6 - @MarkHerhold your idea behind |
|
Fixes #7 - ColumnValue provides this and supports enum as denoted. |
src/ColumnValue.ts
Outdated
|
|
||
| get buffer(): Buffer | null { | ||
| if (this.isNull) return null; | ||
| return Buffer.from((this.field.blobValue || '').toString()); |
There was a problem hiding this comment.
Why should do we call .toString() on a value that I'd presume to be a string?
There was a problem hiding this comment.
Actually, I think this logic is wrong for binary type.
The AWS docs say:
blobValue - A value of BLOB data type. Type: Base64-encoded binary data object
So I think we would need to do Buffer.from(this.field.blobValue, 'base64'). I don't see a test that explicitly tests this logic and I haven't verified my assumption with the real RDS Data API.
There was a problem hiding this comment.
@MarkHerhold - looks like the blobValue can return as Buffer|Uint8Array|Blob|string possible answer I am committing now:
return Buffer.isBuffer(this.field.blobValue) ? this.field.blobValue : Buffer.from(this.field.blobValue as Uint8Array);
|
TODO: I will update the test dB and add a binary column and create a test |
|
@cbschuld just taking a look at the new code and there will still be a problem with Decimal columns saving and reading. |

Overview
An introduction of ColumnValue which was initially conceived by @MarkHerhold
Adds
Updates