connectbase-client 3.13.0 → 3.13.1
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/CHANGELOG.md +12 -0
- package/README.md +31 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
본 SDK 의 모든 주요 변경사항을 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/) 형식으로 기록합니다.
|
|
4
4
|
버전은 [Semantic Versioning](https://semver.org/lang/ko/) 을 따릅니다.
|
|
5
5
|
|
|
6
|
+
## [3.13.1] - 2026-05-13
|
|
7
|
+
|
|
8
|
+
### Documentation — README batch/transaction 예제 타입 회귀 수정
|
|
9
|
+
|
|
10
|
+
README 의 `cb.database.batch()` / `cb.database.transaction()` 예제가 구 시그니처
|
|
11
|
+
(`table: 'string'`) 를 사용해 `tsc --noEmit` 에서 `TS2353` 발생하던 문제 수정.
|
|
12
|
+
|
|
13
|
+
- `table:` → `table_id:` (UUID, 실제 `BatchOperation` 타입과 일치)
|
|
14
|
+
- 3.12+ 의 `success:false` throw 동작 반영 — try/catch 패턴 명시
|
|
15
|
+
|
|
16
|
+
코드 변경은 없음. README 만 갱신.
|
|
17
|
+
|
|
6
18
|
## [3.13.0] - 2026-05-13
|
|
7
19
|
|
|
8
20
|
### Removed — `PlatformIssueDetail.triage_summary` / `triaged_at` 필드
|
package/README.md
CHANGED
|
@@ -587,26 +587,41 @@ nearby.results.forEach(place => {
|
|
|
587
587
|
|
|
588
588
|
#### Batch & Transactions
|
|
589
589
|
|
|
590
|
+
`table_id` 는 항상 UUID. 콘솔/REST 로 생성한 테이블의 UUID 를 그대로 사용한다.
|
|
591
|
+
|
|
592
|
+
v3.12+ 부터 server 가 부분 실패(`success: false`)를 응답하면 SDK 가 첫 실패 op 의
|
|
593
|
+
error 메시지로 throw 한다 — silent success 회귀 방지 차원. 호출자는 try/catch 로 감싼다.
|
|
594
|
+
|
|
590
595
|
```typescript
|
|
591
596
|
// Batch: atomic multi-table operations
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
597
|
+
try {
|
|
598
|
+
const result = await cb.database.batch([
|
|
599
|
+
{ type: 'create', table_id: ORDERS_TABLE_ID, data: { product: 'A', qty: 1 } },
|
|
600
|
+
{ type: 'update', table_id: INVENTORY_TABLE_ID, doc_id: 'item-a', operators: {
|
|
601
|
+
qty: { type: 'increment', value: -1 }
|
|
602
|
+
}},
|
|
603
|
+
{ type: 'update', table_id: STATS_TABLE_ID, doc_id: 'daily', operators: {
|
|
604
|
+
order_count: { type: 'increment', value: 1 },
|
|
605
|
+
last_order: { type: 'serverTimestamp' }
|
|
606
|
+
}}
|
|
607
|
+
])
|
|
608
|
+
// result.success, result.results[i].{success, doc_id, error}
|
|
609
|
+
} catch (e) {
|
|
610
|
+
// RLS 거부 / 검증 실패 / table_id 오타 등 — 전체 batch 가 atomic 하게 롤백
|
|
611
|
+
console.error('batch failed:', (e as Error).message)
|
|
612
|
+
}
|
|
602
613
|
|
|
603
614
|
// Transaction: read-then-write with ACID guarantees
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
615
|
+
try {
|
|
616
|
+
await cb.database.transaction(
|
|
617
|
+
[{ table_id: ACCOUNTS_TABLE_ID, doc_id: 'user-1', alias: 'sender' }],
|
|
618
|
+
[{ type: 'update', table_id: ACCOUNTS_TABLE_ID, doc_id: 'user-1', operators: {
|
|
619
|
+
balance: { type: 'increment', value: -100 }
|
|
620
|
+
}}]
|
|
621
|
+
)
|
|
622
|
+
} catch (e) {
|
|
623
|
+
console.error('transaction failed:', (e as Error).message)
|
|
624
|
+
}
|
|
610
625
|
```
|
|
611
626
|
|
|
612
627
|
#### Populate (Relation Query / JOIN)
|