filecoin-project / filecoin-project/lily
Lily can dump the migration to be applied to STDOUT
- Dominant language
- Go
- Stars
- 52
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
### Description
When troubleshooting migrations, it would be very helpful for you to be able to perform a "dry run" or a "verbose" migration which pipes the queries which would otherwise be sent during `lily migrate --latest|to` to STDOUT without executing them on the host.
### Acceptance criteria
- Some additional argument to `lily migrate` dumps the SQL which would be sent with the current arguments.
### Where to begin
I did a quick looksee if this was easily possible and there doesn't seem to be a way to decouple the statement preparation from the execution within go-pg. Although, I did find a debug feature which spits out the SQL as it's being sent (as a sort of callback). The callback does not support short-circuiting otherwise, this would be perfect.
Example usage: https://github.com/go-pg/pg/blob/c9ee578a38d6866649072df18a3dbb36ff369747/testdata/issue1726.go#L17
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.