pgsql-test
Version:
pgsql-test offers isolated, role-aware, and rollback-friendly PostgreSQL environments for integration tests — giving developers realistic test coverage without external state pollution
21 lines (20 loc) • 657 B
JavaScript
import { getEnvOptions } from '@launchql/types';
import { LaunchQLProject, deployFast } from '@launchql/core';
export function launchql(cwd, cache = false) {
return {
async seed(ctx) {
const proj = new LaunchQLProject(cwd ?? ctx.connect.cwd);
if (!proj.isInModule())
return;
const opts = getEnvOptions({ pg: ctx.config });
await deployFast({
opts,
name: proj.getModuleName(),
database: ctx.config.database,
dir: proj.modulePath,
usePlan: true,
cache
});
}
};
}