Compare commits

..

2 Commits

Author SHA1 Message Date
perfectra1n
81f02209ea feat(db): update index and fix suggestion from gemini 2026-03-22 09:22:55 -07:00
perfectra1n
124d456c60 feat(db): add missing sqlite indices to help with performance 2026-03-22 09:14:33 -07:00
10 changed files with 66 additions and 46 deletions

View File

@@ -53,7 +53,7 @@
"draggabilly": "3.0.0",
"force-graph": "1.51.2",
"globals": "17.4.0",
"i18next": "25.10.5",
"i18next": "25.10.3",
"i18next-http-backend": "3.0.2",
"jquery": "4.0.0",
"jquery.fancytree": "2.38.5",
@@ -68,7 +68,7 @@
"normalize.css": "8.0.1",
"panzoom": "9.4.3",
"preact": "10.29.0",
"react-i18next": "16.6.2",
"react-i18next": "16.6.0",
"react-window": "2.2.7",
"reveal.js": "6.0.0",
"rrule": "2.8.1",
@@ -89,6 +89,6 @@
"happy-dom": "20.8.4",
"lightningcss": "1.32.0",
"script-loader": "0.7.2",
"vite-plugin-static-copy": "3.4.0"
"vite-plugin-static-copy": "3.3.0"
}
}

View File

@@ -446,8 +446,7 @@
"and_more": "... und {{count}} mehr.",
"print_landscape": "Beim Export als PDF, wird die Seitenausrichtung Querformat anstatt Hochformat verwendet.",
"print_page_size": "Beim Export als PDF, wird die Größe der Seite angepasst. Unterstützte Größen: <code>A0</code>, <code>A1</code>, <code>A2</code>, <code>A3</code>, <code>A4</code>, <code>A5</code>, <code>A6</code>, <code>Legal</code>, <code>Letter</code>, <code>Tabloid</code>, <code>Ledger</code>.",
"color_type": "Farbe",
"textarea": "Mehrzeilen-Text"
"color_type": "Farbe"
},
"attribute_editor": {
"help_text_body1": "Um ein Label hinzuzufügen, gebe einfach z.B. ein. <code>#rock</code> oder wenn du auch einen Wert hinzufügen möchten, dann z.B. <code>#year = 2024</code>",

View File

@@ -477,8 +477,7 @@
"and_more": "... agus {{count}} eile.",
"print_landscape": "Agus é á onnmhairiú go PDF, athraítear treoshuíomh an leathanaigh go tírdhreach seachas portráid.",
"print_page_size": "Agus é á easpórtáil go PDF, athraítear méid an leathanaigh. Luachanna tacaithe: <code>A0</code>, <code>A1</code>, <code>A2</code>, <code>A3</code>, <code>A4</code>, <code>A5</code>, <code>A6</code>, <code>Legal</code>, <code>Letter</code>, <code>Tabloid</code>, <code>Ledger</code>.",
"color_type": "Dath",
"textarea": "Téacs Il-líne"
"color_type": "Dath"
},
"attribute_editor": {
"help_text_body1": "Chun lipéad a chur leis, clóscríobh m.sh. <code>#rock</code> nó más mian leat luach a chur leis freisin ansin m.sh. <code>#year = 2020</code>",

View File

@@ -5,7 +5,7 @@
"description": "Tool to compare content of Trilium databases. Useful for debugging sync problems.",
"dependencies": {
"colors": "1.4.0",
"diff": "8.0.4",
"diff": "8.0.3",
"sqlite": "5.1.1",
"sqlite3": "6.0.1"
},

View File

@@ -99,7 +99,7 @@
"html2plaintext": "2.1.4",
"http-proxy-agent": "8.0.0",
"https-proxy-agent": "8.0.0",
"i18next": "25.10.5",
"i18next": "25.10.3",
"i18next-fs-backend": "2.6.1",
"image-type": "6.0.0",
"ini": "6.0.0",

View File

@@ -79,7 +79,7 @@ CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes"
`entityId`
);
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
CREATE INDEX IDX_branches_parentNoteId_isDeleted_notePosition ON branches (parentNoteId, isDeleted, notePosition);
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
@@ -146,6 +146,13 @@ CREATE INDEX IDX_notes_blobId on notes (blobId);
CREATE INDEX IDX_revisions_blobId on revisions (blobId);
CREATE INDEX IDX_attachments_blobId on attachments (blobId);
CREATE INDEX IDX_entity_changes_isSynced_id ON entity_changes (isSynced, id);
CREATE INDEX IDX_entity_changes_isErased_entityName ON entity_changes (isErased, entityName);
CREATE INDEX IDX_notes_isDeleted_utcDateModified ON notes (isDeleted, utcDateModified);
CREATE INDEX IDX_branches_isDeleted_utcDateModified ON branches (isDeleted, utcDateModified);
CREATE INDEX IDX_attributes_isDeleted_utcDateModified ON attributes (isDeleted, utcDateModified);
CREATE INDEX IDX_attachments_isDeleted_utcDateModified ON attachments (isDeleted, utcDateModified);
CREATE INDEX IDX_attachments_utcDateScheduledForErasureSince ON attachments (utcDateScheduledForErasureSince);
CREATE TABLE IF NOT EXISTS sessions (
id TEXT PRIMARY KEY,

View File

@@ -6,6 +6,27 @@
// Migrations should be kept in descending order, so the latest migration is first.
const MIGRATIONS: (SqlMigration | JsMigration)[] = [
// Add missing database indices for query performance
{
version: 235,
sql: /*sql*/`
CREATE INDEX IF NOT EXISTS IDX_entity_changes_isSynced_id
ON entity_changes (isSynced, id);
CREATE INDEX IF NOT EXISTS IDX_entity_changes_isErased_entityName
ON entity_changes (isErased, entityName);
CREATE INDEX IF NOT EXISTS IDX_notes_isDeleted_utcDateModified
ON notes (isDeleted, utcDateModified);
CREATE INDEX IF NOT EXISTS IDX_branches_isDeleted_utcDateModified
ON branches (isDeleted, utcDateModified);
CREATE INDEX IF NOT EXISTS IDX_attributes_isDeleted_utcDateModified
ON attributes (isDeleted, utcDateModified);
CREATE INDEX IF NOT EXISTS IDX_attachments_isDeleted_utcDateModified
ON attachments (isDeleted, utcDateModified);
DROP INDEX IF EXISTS IDX_branches_parentNoteId;
CREATE INDEX IF NOT EXISTS IDX_branches_parentNoteId_isDeleted_notePosition
ON branches (parentNoteId, isDeleted, notePosition);
`
},
// Migrate aiChat notes to code notes since LLM integration has been removed
{
version: 234,

View File

@@ -5,7 +5,7 @@ import packageJson from "../../package.json" with { type: "json" };
import build from "./build.js";
import dataDir from "./data_dir.js";
const APP_DB_VERSION = 234;
const APP_DB_VERSION = 235;
const SYNC_VERSION = 37;
const CLIPPER_PROTOCOL_VERSION = "1.0";

View File

@@ -9,12 +9,12 @@
"preview": "pnpm build && vite preview"
},
"dependencies": {
"i18next": "25.10.5",
"i18next": "25.10.3",
"i18next-http-backend": "3.0.2",
"preact": "10.29.0",
"preact-iso": "2.11.1",
"preact-render-to-string": "6.6.6",
"react-i18next": "16.6.2"
"react-i18next": "16.6.0"
},
"devDependencies": {
"@preact/preset-vite": "2.10.5",

60
pnpm-lock.yaml generated
View File

@@ -297,8 +297,8 @@ importers:
specifier: 17.4.0
version: 17.4.0
i18next:
specifier: 25.10.5
version: 25.10.5(typescript@5.9.3)
specifier: 25.10.3
version: 25.10.3(typescript@5.9.3)
i18next-http-backend:
specifier: 3.0.2
version: 3.0.2(encoding@0.1.13)
@@ -342,8 +342,8 @@ importers:
specifier: 10.29.0
version: 10.29.0
react-i18next:
specifier: 16.6.2
version: 16.6.2(i18next@25.10.5(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3)
specifier: 16.6.0
version: 16.6.0(i18next@25.10.3(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3)
react-window:
specifier: 2.2.7
version: 2.2.7(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
@@ -400,8 +400,8 @@ importers:
specifier: 0.7.2
version: 0.7.2
vite-plugin-static-copy:
specifier: 3.4.0
version: 3.4.0(vite@8.0.1(@types/node@24.12.0)(esbuild@0.27.4)(jiti@2.6.1)(less@4.1.3)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.2))
specifier: 3.3.0
version: 3.3.0(vite@8.0.1(@types/node@24.12.0)(esbuild@0.27.4)(jiti@2.6.1)(less@4.1.3)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.2))
apps/db-compare:
dependencies:
@@ -409,8 +409,8 @@ importers:
specifier: 1.4.0
version: 1.4.0
diff:
specifier: 8.0.4
version: 8.0.4
specifier: 8.0.3
version: 8.0.3
sqlite:
specifier: 5.1.1
version: 5.1.1
@@ -755,8 +755,8 @@ importers:
specifier: 8.0.0
version: 8.0.0
i18next:
specifier: 25.10.5
version: 25.10.5(typescript@5.9.3)
specifier: 25.10.3
version: 25.10.3(typescript@5.9.3)
i18next-fs-backend:
specifier: 2.6.1
version: 2.6.1
@@ -870,8 +870,8 @@ importers:
apps/website:
dependencies:
i18next:
specifier: 25.10.5
version: 25.10.5(typescript@5.9.3)
specifier: 25.10.3
version: 25.10.3(typescript@5.9.3)
i18next-http-backend:
specifier: 3.0.2
version: 3.0.2(encoding@0.1.13)
@@ -885,8 +885,8 @@ importers:
specifier: 6.6.6
version: 6.6.6(preact@10.29.0)
react-i18next:
specifier: 16.6.2
version: 16.6.2(i18next@25.10.5(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3)
specifier: 16.6.0
version: 16.6.0(i18next@25.10.3(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3)
devDependencies:
'@preact/preset-vite':
specifier: 2.10.5
@@ -8871,10 +8871,6 @@ packages:
resolution: {integrity: sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==}
engines: {node: '>=0.3.1'}
diff@8.0.4:
resolution: {integrity: sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==}
engines: {node: '>=0.3.1'}
dir-compare@4.2.0:
resolution: {integrity: sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==}
@@ -10320,8 +10316,8 @@ packages:
i18next-http-backend@3.0.2:
resolution: {integrity: sha512-PdlvPnvIp4E1sYi46Ik4tBYh/v/NbYfFFgTjkwFl0is8A18s7/bx9aXqsrOax9WUbeNS6mD2oix7Z0yGGf6m5g==}
i18next@25.10.5:
resolution: {integrity: sha512-jRnF7eRNsdcnh7AASSgaU3lj/8lJZuHkfsouetnLEDH0xxE1vVi7qhiJ9RhdSPUyzg4ltb7P7aXsFlTk9sxL2w==}
i18next@25.10.3:
resolution: {integrity: sha512-9XCjFgF7q4wNdmy7RFcDBIx1ndSXU3QwtbmqPjOdUxYxU9gbovJzZUY5Mb3ejWmDhxMl6Wmr2OenWOU3uyy6VQ==}
peerDependencies:
typescript: ^5
peerDependenciesMeta:
@@ -13243,8 +13239,8 @@ packages:
peerDependencies:
react: ^19.2.4
react-i18next@16.6.2:
resolution: {integrity: sha512-/S/GPzElTqEi5o2kzd0/O2627hPDmE6OGhJCCwCfUaQ3syyu+kaYH8/PYFtZeWc25NzfxTN/2fD1QjvrTgrFfA==}
react-i18next@16.6.0:
resolution: {integrity: sha512-bxVftl2q/pfupKVmBH80ui1rHl3ia2sdcR0Yhn6cr0PyoHfO8JLZ19fccwOIH+0dMBCIkdO5gAmEQFCTAggeQg==}
peerDependencies:
i18next: '>= 25.6.2'
react: '>= 16.8.0'
@@ -15268,8 +15264,8 @@ packages:
vite:
optional: true
vite-plugin-static-copy@3.4.0:
resolution: {integrity: sha512-ekryzCw0ouAOE8tw4RvVL/dfqguXzumsV3FBKoKso4MQ1MUUrUXtl5RI4KpJQUNGqFEsg9kxl4EvDl02YtA9VQ==}
vite-plugin-static-copy@3.3.0:
resolution: {integrity: sha512-XiAtZcev7nppxNFgKoD55rfL+ukVp/RtrnTJONRwRuzv/B2FK2h2ZRCYjvxhwBV/Oarse83SiyXBSxMTfeEM0Q==}
engines: {node: ^18.0.0 || >=20.0.0}
peerDependencies:
vite: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0
@@ -26212,8 +26208,6 @@ snapshots:
diff@8.0.3: {}
diff@8.0.4: {}
dir-compare@4.2.0:
dependencies:
minimatch: 3.1.5
@@ -28298,7 +28292,7 @@ snapshots:
transitivePeerDependencies:
- encoding
i18next@25.10.5(typescript@5.9.3):
i18next@25.10.3(typescript@5.9.3):
dependencies:
'@babel/runtime': 7.29.2
optionalDependencies:
@@ -30122,7 +30116,7 @@ snapshots:
browser-stdout: 1.3.1
chokidar: 4.0.3
debug: 4.4.3(supports-color@8.1.1)
diff: 8.0.4
diff: 8.0.3
escape-string-regexp: 4.0.0
find-up: 5.0.0
glob: 13.0.6
@@ -31588,11 +31582,11 @@ snapshots:
react: 19.2.4
scheduler: 0.27.0
react-i18next@16.6.2(i18next@25.10.5(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3):
react-i18next@16.6.0(i18next@25.10.3(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3):
dependencies:
'@babel/runtime': 7.29.2
html-parse-stringify: 3.0.1
i18next: 25.10.5(typescript@5.9.3)
i18next: 25.10.3(typescript@5.9.3)
react: 19.2.4
use-sync-external-store: 1.6.0(react@19.2.4)
optionalDependencies:
@@ -33531,7 +33525,7 @@ snapshots:
acorn-walk: 8.3.4
arg: 4.1.3
create-require: 1.1.1
diff: 8.0.4
diff: 8.0.3
make-error: 1.3.6
typescript: 5.0.4
v8-compile-cache-lib: 3.0.1
@@ -33551,7 +33545,7 @@ snapshots:
acorn-walk: 8.3.4
arg: 4.1.3
create-require: 1.1.1
diff: 8.0.4
diff: 8.0.3
make-error: 1.3.6
typescript: 5.9.3
v8-compile-cache-lib: 3.0.1
@@ -34051,7 +34045,7 @@ snapshots:
- rollup
- supports-color
vite-plugin-static-copy@3.4.0(vite@8.0.1(@types/node@24.12.0)(esbuild@0.27.4)(jiti@2.6.1)(less@4.1.3)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.2)):
vite-plugin-static-copy@3.3.0(vite@8.0.1(@types/node@24.12.0)(esbuild@0.27.4)(jiti@2.6.1)(less@4.1.3)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.2)):
dependencies:
chokidar: 3.6.0
p-map: 7.0.4