@biaoo/tiangong-wiki 0.3.4 → 0.3.5
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/dist/core/indexer.js +9 -9
- package/package.json +1 -1
package/dist/core/indexer.js
CHANGED
|
@@ -184,6 +184,15 @@ export function applyChanges(db, changes, wikiPath, config, ftsExtensionVersion)
|
|
|
184
184
|
const summaryChangedIds = [];
|
|
185
185
|
const hasContentChanges = parsedEntries.length > 0 || changes.deleted.length > 0;
|
|
186
186
|
const transaction = db.transaction(() => {
|
|
187
|
+
for (const page of changes.deleted) {
|
|
188
|
+
const existing = selectPageRowid.get(page.id);
|
|
189
|
+
deleteEdgesBySourcePage.run(page.id);
|
|
190
|
+
if (existing) {
|
|
191
|
+
deleteVecRow.run(BigInt(existing.rowid));
|
|
192
|
+
}
|
|
193
|
+
deletePage.run(page.id);
|
|
194
|
+
deleted.push(page.id);
|
|
195
|
+
}
|
|
187
196
|
for (const { entry, parsed } of parsedEntries) {
|
|
188
197
|
const existing = selectExistingPage.get(entry.id);
|
|
189
198
|
const isInsert = !existing;
|
|
@@ -217,15 +226,6 @@ export function applyChanges(db, changes, wikiPath, config, ftsExtensionVersion)
|
|
|
217
226
|
});
|
|
218
227
|
}
|
|
219
228
|
}
|
|
220
|
-
for (const page of changes.deleted) {
|
|
221
|
-
const existing = selectPageRowid.get(page.id);
|
|
222
|
-
deleteEdgesBySourcePage.run(page.id);
|
|
223
|
-
if (existing) {
|
|
224
|
-
deleteVecRow.run(BigInt(existing.rowid));
|
|
225
|
-
}
|
|
226
|
-
deletePage.run(page.id);
|
|
227
|
-
deleted.push(page.id);
|
|
228
|
-
}
|
|
229
229
|
if (hasContentChanges) {
|
|
230
230
|
rebuildFts(db, config, ftsExtensionVersion);
|
|
231
231
|
}
|