Tear down databases manually feature request
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- node.js, postgresql, shell
- Domain
- api, databases, testing-qa
Research direction
Start by reading the existing stop command in pg_tmp.sh and the Node.js API that invokes it. Define how the manual teardown function should be exposed from createDb, using the Vitest example as the intended usage. Done means callers can invoke teardownDb during test cleanup and the existing database shutdown behavior is reused.
Written by the indexing model from the issue text.
Description
I think a feature that can be added to this library would be to tear down databases manually.
A use case for this would be to do this in the "tear-down" section in testing frameworks. For example, in vitest a possible implementation of this would be:
import {describe, test, beforeAll} from "vitest";
import createDb from "pg-tmp";
describe("Database test", () => {
beforeAll(async () => {
const { teardownDb } = await createDb();
// return cleanup function
return async () => {
await teardownDb();
};
});
test("specific database tests", () => {
// tests with the database.
});
});
This should be easy to implement using the "stop" command already implemented in pg_tmp.sh.
I'd be up to make a PR myself, but I figured I'd get permission first & so forth.
- Dominant language
- Shell
- Stars
- 1
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·
-
docs(agents): strengthen the no-backslash-escaped-backticks rule with an issue-creation example Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
technical-debt
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
ll7/robot_sf_ll7#9560 ·
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100