跳到主要内容

RawWriteContext

type RawWriteContext =
| {
capabilityEnabled: false;
}
| {
capabilityEnabled: true;
gate: RawWriteGate;
};

Defined in: packages/rxdb/src/capture/raw-write-gate.ts:45

某个适配器实例当前的 raw 写判定上下文(adapter-contract.md §2)

Union Members​

Type Literal​

{
capabilityEnabled: false;
}

capabilityEnabled​

readonly capabilityEnabled: false;

这个数据库没有启用提交能力;raw 写无条件放行


Type Literal​

{
capabilityEnabled: true;
gate: RawWriteGate;
}

capabilityEnabled​

readonly capabilityEnabled: true;

这个数据库启用了提交能力

gate​

readonly gate: RawWriteGate;

判定入口;来自装在这个适配器上的捕获运行时

Remarks​

由 RxDBAdapterLocalBase.workingTreeRawWriteContext 交出,适配器原样转给 gateRawWrite, 中途不拆开、不补字段。六个适配器需要写对的因此只有「把它转给门」这一句, 「能力位怎么算」「判定去哪找」两个真正容易写歪的问题一次都不会落到它们头上。