You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all — awesome work! Having lightweight on-the-fly instances of PostgreSQL is a game changer.
We use pglite to run our DB tests. Our test runner is AVA. Even though AVA runs test cases in the same file in parallel, we find that pglite tests always complete serially. It appears that pglite only permits 1 in-memory DB to be used at a time.
Can pglite support multiple in-mem databases being created/connected/queried at once? Specifically for node.js, as the browser might understandably have different constraints.
What would it take for this to work?
Example usage:
// set up DB named neondb (required by migrations)constdb0=awaitPGlite.create();awaitdb0.query('CREATE DATABASE neondb');constdump0=awaitdb0.dumpDataDir();awaitdb0.close();// apply migrationsconstdb1=awaitPGlite.create({loadDataDir: dump0,database: 'neondb',extensions: {
vector,},});awaitapplyMigrations(db1);constdump1=awaitdb1.dumpDataDir();awaitdb1.close();// the above runs once per test suite (reused)// the below runs once per test caseexportasyncfunctiongetTestSql(t){constdb=awaitPGlite.create({loadDataDir: dump1,database: 'neondb',extensions: {
vector,},});t.teardown(async()=>{awaitdb.close();});
...
}
The text was updated successfully, but these errors were encountered:
First of all — awesome work! Having lightweight on-the-fly instances of PostgreSQL is a game changer.
We use pglite to run our DB tests. Our test runner is AVA. Even though AVA runs test cases in the same file in parallel, we find that pglite tests always complete serially. It appears that pglite only permits 1 in-memory DB to be used at a time.
Can pglite support multiple in-mem databases being created/connected/queried at once? Specifically for node.js, as the browser might understandably have different constraints.
What would it take for this to work?
Example usage:
The text was updated successfully, but these errors were encountered: