feat: harden loose-offline sync for user JWT, schema, and console ops
Enable Binding-scoped agent push/pull, empty-table schema ensure, SyncPage inspect/drop-table, default module import, and agent-bound publish docs from the 宇恒联调意见. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -35,6 +35,22 @@ CREATE TABLE IF NOT EXISTS orders (
|
||||
|
||||
形态 B 下本机 SQLite 可能不可达:至少 **remote** 须能完成校验。
|
||||
|
||||
### 线上库 A DSN(生产统一 Postgres)
|
||||
|
||||
```text
|
||||
postgres://user:pass@127.0.0.1:5432/app_online?sslmode=disable
|
||||
```
|
||||
|
||||
联调临时可用 SQLite(不宜多 writer):
|
||||
|
||||
```text
|
||||
file:E:/data/ajz_remote.db?_pragma=foreign_keys(1)
|
||||
```
|
||||
|
||||
使用正斜杠;平台会规范化反斜杠并补 `busy_timeout`。
|
||||
|
||||
单服务器一条通道即可;多服务器为**每台线上库各建一条通道**,客户端选用对应 `channel_id`。
|
||||
|
||||
## 宇恒开通(opt-in)
|
||||
|
||||
```bash
|
||||
@@ -55,6 +71,9 @@ YXD_SYNC_DBSYNC_TABLES=orders,order_items
|
||||
|
||||
推送落到通道 **remote**(线上 A),幂等认客户端 version;平台不连用户本机 SQLite。
|
||||
|
||||
**幂等**:同 version 再 push → `{ success:true, result:{ skipped:true, ... } }`;重复 HTTP 安全,线上不双行。
|
||||
**可重试**:remote IO 失败 → `503` + `retryable:true`(勿换 UUID)。
|
||||
|
||||
宇恒建议环境变量(由对方配置,不在智建仓改):
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user