update pglite, use opfs

This commit is contained in:
duanfuxiang 2025-06-22 17:26:54 +08:00
parent a81d5b159e
commit 0df4e4edd3
6 changed files with 958 additions and 18 deletions

View File

@ -1,7 +0,0 @@
{
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}

8
.prettierrc.json Normal file
View File

@ -0,0 +1,8 @@
{
"tabWidth": 4,
"useTabs": true,
"printWidth": 120,
"semi": false,
"bracketSameLine": true,
"ignore": ["node_modules", "dist", "build", "out", ".next", ".venv", "pnpm-lock.yaml"]
}

View File

@ -89,7 +89,7 @@
"js-tiktoken": "^1.0.15",
"js-yaml": "^4.1.0",
"json5": "^2.2.3",
"langchain": "^0.3.2",
"langchain": "^0.3.15",
"lexical": "^0.17.1",
"lodash": "^4.17.21",
"lodash.debounce": "^4.0.8",

955
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,6 @@ export const createAndInitDb = async () => {
},
},
)
console.log('PGlite DB created')
console.log('PGlite DB created in opfs-ahp://infio-db')
return pg
}

View File

@ -48,7 +48,7 @@ worker({
const { fsBundle, wasmModule, vectorExtensionBundlePath } =
await loadPGliteResources()
db = await PGlite.create('idb://infio-db', {
db = await PGlite.create('opfs-ahp://infio-db', {
relaxedDurability: true,
fsBundle: fsBundle,
wasmModule: wasmModule,