feat(0.2.1): M3 前端 PowerSync 基础 (schema/connector/db) + 依赖; fix storage sslmode

This commit is contained in:
jif2.zhang
2026-10-26 00:07:33 +08:00
parent a386660833
commit a4af607c41
6 changed files with 246 additions and 0 deletions
+94
View File
@@ -0,0 +1,94 @@
// PowerSync 客户端 schema (0.2.1 离线编辑)
// 表名/列名与 deploy/0.2.1/powersync/sync-config.yaml 的输出严格一致 (PascalCase + text 型 id 由 SDK 自建)
// 见 docs/V0.2/离线编辑模块/0.2.1实施方案.md
import { column, Schema, Table } from '@powersync/web'
// 时间/JSON 列在同步流里以文本落地, 本地按字符串读写 (JSON 列为 JSON 字符串)
const project = new Table(
{
uuid: column.text,
code: column.text,
name: column.text,
ownerId: column.text,
isPersonal: column.integer,
archived: column.integer,
notes: column.text,
taskKinds: column.text,
icon: column.text,
createdAt: column.text,
updatedAt: column.text,
},
{ indexes: { code: ['code'] } },
)
const projectMember = new Table({
uuid: column.text,
projectId: column.text,
userId: column.text,
permission: column.text,
createdAt: column.text,
})
const boardColumn = new Table(
{
uuid: column.text,
projectId: column.text,
name: column.text,
sortOrder: column.integer,
boundStatus: column.text,
retention: column.text,
createdAt: column.text,
updatedAt: column.text,
},
{ indexes: { project: ['projectId'] } },
)
const task = new Table(
{
uuid: column.text,
projectId: column.text,
columnId: column.text,
parentId: column.text,
title: column.text,
description: column.text,
kind: column.text,
markDate: column.text,
status: column.text,
doneAt: column.text,
assigneeId: column.text,
creatorId: column.text,
extras: column.text,
sortOrder: column.integer,
number: column.integer,
createdAt: column.text,
updatedAt: column.text,
},
{ indexes: { project: ['projectId'], column: ['columnId'], number: ['projectId', 'number'] } },
)
const taskMember = new Table({
uuid: column.text,
taskId: column.text,
userId: column.text,
})
const taskTag = new Table({
uuid: column.text,
taskId: column.text,
name: column.text,
})
const user = new Table({
name: column.text,
email: column.text,
})
export const AppSchema = new Schema({
Project: project,
ProjectMember: projectMember,
BoardColumn: boardColumn,
Task: task,
TaskMember: taskMember,
TaskTag: taskTag,
User: user,
})