@taylordb/query-builder 0.16.5 → 0.17.0

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.
@@ -189,7 +189,7 @@ Cross-table filtering is also supported — see [conditions.md](./conditions.md)
189
189
 
190
190
  - **Select**: `string[]` — array of absolute URLs (automatically resolved by the query builder)
191
191
  - **Insert**: `Attachment[] | number[]`
192
- - **Update**: `Attachment[] | number[] | { newIds: number[]; deletedIds: number[] }`
192
+ - **Update**: `Attachment[] | number[] | { newAttachments: Attachment[]; deletedUrls: string[] }`
193
193
 
194
194
  For how to produce `Attachment` instances, see [file-upload.md](./file-upload.md).
195
195
 
@@ -55,15 +55,19 @@ await qb
55
55
  .execute();
56
56
  ```
57
57
 
58
- To replace some attachments while keeping others, use the `{ newIds, deletedIds }` form that `AttachmentColumnType` update accepts:
58
+ To replace some attachments while keeping others, use the `{ newAttachments, deletedUrls }` form that `AttachmentColumnType` update accepts:
59
59
 
60
60
  ```ts
61
+ const uploadedAttachments = await qb.uploadAttachments([
62
+ { file: replacementBlob, name: 'replacement.jpg' },
63
+ ]);
64
+
61
65
  await qb
62
66
  .update('expenses')
63
67
  .set({
64
68
  receipt: {
65
- newIds: [uploadedAttachment._id], // IDs of newly uploaded files
66
- deletedIds: [123], // DB IDs of files to remove
69
+ newAttachments: uploadedAttachments,
70
+ deletedUrls: ['https://media.taylordb.ai/files/something.jpg'],
67
71
  },
68
72
  })
69
73
  .where('id', '=', 42)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taylordb/query-builder",
3
- "version": "0.16.5",
3
+ "version": "0.17.0",
4
4
  "description": "A type-safe query builder for TaylorDB",
5
5
  "private": false,
6
6
  "main": "./dist/cjs/index.js",
@@ -31,7 +31,7 @@
31
31
  "lodash": "^4.17.21",
32
32
  "socket.io-client": "^4.8.1",
33
33
  "zod": "^4.1.12",
34
- "@taylordb/shared": "0.16.5"
34
+ "@taylordb/shared": "0.17.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/eventemitter3": "^2.0.4",