wasp icon indicating copy to clipboard operation
wasp copied to clipboard

Provide `setupFn` for PgBoss options

Open infomiho opened this issue 4 months ago • 0 comments

Motivated by this issue: https://github.com/wasp-lang/wasp/issues/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)
}

infomiho avatar Jun 18 '25 09:06 infomiho