Open
Description
Motivated by this issue: #2846
Currently we ask users to pass JSON via env variables to set up PgBoss which is not the best DX. It's also fragile since the current implementation overrides the connection string:
function createPgBoss() {
let pgBossNewOptions = {
connectionString: config.databaseUrl,
}
if (env.PG_BOSS_NEW_OPTIONS) {
pgBossNewOptions = JSON.parse(env.PG_BOSS_NEW_OPTIONS)
}
return new PgBoss(pgBossNewOptions)
}