Skip to content

Commit d02d578

Browse files
committed
fix to chain pg_dump
1 parent ccf57af commit d02d578

File tree

3 files changed

+123
-0
lines changed

3 files changed

+123
-0
lines changed

apps/web/components/sidebar/database-menu-item.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ export function DatabaseMenuItem({ database, isActive, onClick }: DatabaseMenuIt
328328
if (event.data.action === 'dump-result') {
329329
downloadFileFromUrl(event.data.url, event.data.filename)
330330
bc.close()
331+
setIsPopoverOpen(false)
331332
}
332333
})
333334

apps/web/lib/db/worker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ worker({
2121
bc.addEventListener('message', async (event) => {
2222
if (event.data.action === 'execute-dump') {
2323
let dump = await pgDump({ pg: db })
24+
// clear prepared statements
25+
await db.query('deallocate all')
2426
let dumpContent = await dump.text()
2527
// patch for old PGlite versions where the vector extension was not included in the dump
2628
if (!dumpContent.includes('CREATE EXTENSION IF NOT EXISTS vector WITH SCHEMA public;')) {

package-lock.json

Lines changed: 120 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)