Facilitates the maintenance of a simple PostgreSQL schema by running queries at boot time or in case of a TDD reset event.
This service depends on pg-service.
Default: {}
Provide configuration to the build extension.
Default: {}
Provide configuration to the seed extension.
Default: {}
Provide configuration to the reset extension.
const f1 = {
target: "$PG_SCHEMA_BUILD",
handler: async ({ query, config }) => {
await query("CREATE TABLE ...");
await query("CREATE TABLE ...");
}
};
const f1 = {
target: "$PG_SCHEMA_SEED",
handler: async ({ query, config }) => {
await query("INSERT INTO ... ON CONFLICT DO NOTHING");
await query("INSERT INTO ... ON CONFLICT DO NOTHING");
}
};
const f1 = {
target: "$PG_SCHEMA_RESET",
handler: async ({ query, config }) => {
await query("DROP TABLE ...");
await query("DROP TABLE ...");
}
};