-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
sqlite: support ArrayBuffer and TypedArray in StatementSync
#56385
base: main
Are you sure you want to change the base?
Conversation
79ca6ef
to
aa1218f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56385 +/- ##
=======================================
Coverage 88.53% 88.53%
=======================================
Files 657 657
Lines 190689 190720 +31
Branches 36597 36603 +6
=======================================
+ Hits 168826 168862 +36
+ Misses 15030 15029 -1
+ Partials 6833 6829 -4
|
@@ -930,7 +930,8 @@ bool StatementSync::BindParams(const FunctionCallbackInfo<Value>& args) { | |||
int anon_idx = 1; | |||
int anon_start = 0; | |||
|
|||
if (args[0]->IsObject() && !args[0]->IsUint8Array()) { | |||
if (args[0]->IsObject() && !args[0]->IsUint8Array() && | |||
!args[0]->IsTypedArray() && !args[0]->IsArrayBuffer()) { |
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.
Using IsArrayBufferView()
here is likely a lot better than separate IsUint8Array()
and IsTypedArray()
checks.
} | ||
|
||
const arrayBuffer = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]).buffer; | ||
const TypedArrays = [ |
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.
Should DataView
also be supported?
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.
Yeah I think so
Co-authored-by: Antoine du Hamel <[email protected]>
Fixes: #56384