xataio / pgroll

PostgreSQL zero-downtime migrations made easy
https://www.xata.io
Apache License 2.0
2.99k stars 54 forks source link

Use the connection defined by `WithRawSQLURL` for backfill operations #320

Closed andrew-farries closed 6 months ago

andrew-farries commented 6 months ago

https://github.com/xataio/pgroll/pull/315 added the option to use a separate connection for raw SQL operations.

The same arguments about using a separate, more restrictive connection to run raw SQL operations also apply to running up and down SQL during backfill operations.

This PR changes the backfill operation to use the alternative connection if defined.

andrew-farries commented 6 months ago

@exekias I don't think this PR makes sense, as the backfill will ultimately be performed by the code in the trigger.

Altering the connection used to call the backfill method won't affect what the trigger is able to run even if there is a proxy on the connection that starts the backfill process; the only code run by that connection directly is the SELECT.... statements executed by the batcher.

I think the PR should be closed.

exekias commented 6 months ago

SGTM!