Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static method to delete databases #142

Open
samwillis opened this issue Aug 2, 2024 · 1 comment
Open

Add static method to delete databases #142

samwillis opened this issue Aug 2, 2024 · 1 comment

Comments

@samwillis
Copy link
Collaborator

With v0.2 we will have this api as an options for specifying a VFS:

import { IdbFs } from "@electric-sql/pglite";
const pg = new PGlite({
  fs: new IdbFs("my-database")
})

We should add a delete static method to the VFS interface that deletes the database from the underlying storage:

import { IdbFs } from "@electric-sql/pglite";

IdbFs.delete('my-database')
@codewithcheese
Copy link

codewithcheese commented Aug 13, 2024

Would also like a method to clear the database. For unit testing re-initializing pglite every test is too slow. I am using a query to drop all tables in my afterEach but would prefer a more deterministic method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants