@hakodb/client 0.6.8 → 0.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hakodb/client",
3
- "version": "0.6.8",
3
+ "version": "0.6.10",
4
4
  "description": "High-level HakoDB JavaScript/TypeScript client for Node.js and Bun",
5
5
  "repository": {
6
6
  "type": "git",
package/src/client.ts CHANGED
@@ -1701,6 +1701,14 @@ export class WriteBatch {
1701
1701
  }
1702
1702
  }
1703
1703
 
1704
+ /** #250: one FFI call per document via hk_batch_set_json. */
1705
+ setJSON(docRef: DocumentReference, data: HakoDocData): WriteBatch {
1706
+ this.ensureActive();
1707
+ const json = JSON.stringify(data);
1708
+ ensureOk(this.native.batchSetJSON(this.handle, docRef._collection, docRef._id, json), this.native, 'batchSetJSON');
1709
+ return this;
1710
+ }
1711
+
1704
1712
  delete(docRef: DocumentReference): WriteBatch {
1705
1713
  this.ensureActive();
1706
1714
  ensureOk(this.native.batchDelete(this.handle, docRef._collection, docRef._id), this.native, 'batchDelete');
package/src/native.ts CHANGED
@@ -609,6 +609,12 @@ async function createBunBindings(libPath: string): Promise<NativeBindings> {
609
609
  hk_cursor_walk_view: { args: [FFIType.ptr, FFIType.ptr, FFIType.function, FFIType.ptr], returns: FFIType.i64 },
610
610
  hk_rawdoc_bytes: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
611
611
  hk_rawdoc_id: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
612
+ hk_view_get: { args: [FFIType.ptr, FFIType.cstring, FFIType.cstring], returns: FFIType.ptr },
613
+ hk_view_get_int: { args: [FFIType.ptr, FFIType.cstring, FFIType.ptr], returns: FFIType.bool },
614
+ hk_view_get_float: { args: [FFIType.ptr, FFIType.cstring, FFIType.ptr], returns: FFIType.bool },
615
+ hk_view_get_bool: { args: [FFIType.ptr, FFIType.cstring], returns: FFIType.i32 },
616
+ hk_view_field_count: { args: [FFIType.ptr], returns: FFIType.u32 },
617
+ hk_view_has_field: { args: [FFIType.ptr, FFIType.cstring], returns: FFIType.bool },
612
618
  hk_view_get_str: { args: [FFIType.ptr, FFIType.cstring, FFIType.ptr], returns: FFIType.ptr },
613
619
  hk_view_get_bytes: { args: [FFIType.ptr, FFIType.cstring, FFIType.ptr], returns: FFIType.ptr },
614
620
  hk_engine_get_json: { args: [FFIType.ptr, FFIType.cstring, FFIType.cstring], returns: FFIType.ptr },