Skip to content

Commit c6fd9cd

Browse files
authored
Merge pull request #5 from powersync-ja/feat/array-buffers
feat: Added support for binding values that are ArrayBuffers
2 parents a46f3db + 371c973 commit c6fd9cd

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.changeset/nine-worms-love.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@powersync/sql-js": patch
3+
---
4+
5+
Added support for binding values that are ArrayBuffers. This is needed downstream for the Rust sync implementation.

patches/powersync-update-002.patch

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/src/api.js b/src/api.js
2+
index c7f102b..2d2d106 100644
3+
--- a/src/api.js
4+
+++ b/src/api.js
5+
@@ -613,6 +613,11 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
6+
if (val === null) {
7+
return this.bindNull(pos);
8+
}
9+
+
10+
+ // Add ArrayBuffer support
11+
+ if (val instanceof ArrayBuffer) {
12+
+ return this.bindBlob(new Uint8Array(val), pos);
13+
+ }
14+
if (val.length != null) {
15+
return this.bindBlob(val, pos);
16+
}

0 commit comments

Comments
 (0)