feat(DEVWF-935): add deno script for running pg-delta#4605
feat(DEVWF-935): add deno script for running pg-delta#4605sweatybridge merged 7 commits intodevelopfrom
Conversation
Pull Request Test Coverage Report for Build 20749972864Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
a956b50 to
9baac15
Compare
99d230e to
8c0eb24
Compare
| // Force close event loop | ||
| throw new Error(""); |
There was a problem hiding this comment.
@avallete btw do you know if pgdelta starts anything in the background that doesn't get killed on error? The deno worker exits successfully with migra.ts but not pgdelta.ts
There was a problem hiding this comment.
Had a look up to it but nothing stands out.
Maybe in case of error the db connection needs to be manually closed ? 🤔
Also locally updated the implementation to:
try {
const result = await createPlan(source, target, supabase);
const statements = result?.plan.statements ?? [];
for (const sql of statements) {
console.log(`${sql};`);
}
throw new Error("aijdoaijdiosj");
} catch (e) {
console.error(e);
// // Force close event loop
// throw new Error("");
}And in such case, I get a proper exit:
➜ cli git:(develop) ✗ go run . db diff --use-pg-delta
Creating shadow database...
Initialising schema...
Seeding globals from roles.sql...
Diffing schemas...
<stack-trace>
error diffing schema: error running container: exit 1:
Error: aijdoaijdiosj
at file:///var/tmp/sb-compile-edge-runtime/index.ts:18:9
at Object.runMicrotasks (ext:core/01_core.js:683:26)
at processTicksAndRejections (ext:deno_node/_next_tick.ts:59:10)
at runNextTicks (ext:deno_node/_next_tick.ts:76:3)
at eventLoopTick (ext:core/01_core.js:182:21)
main worker has been destroyed
Try rerunning the command with --debug to troubleshoot the error.
exit status 1
There was a problem hiding this comment.
It only hangs on error if I don't bubble it up, for eg. trying to diff a linked project (permission error due to temp role).
What kind of change does this PR introduce?
feature
What is the new behavior?
Additional context
Add any other context or screenshots.