mzabani / codd

Codd is a simple-to-use CLI tool that applies plain postgres SQL migrations atomically with strong and automatic cross-environment schema equality checks.
Other
38 stars 1 forks source link

Add new command to apply arbitrary SQL with no strings attached, similar to `psql -f` #185

Closed mzabani closed 4 months ago

mzabani commented 7 months ago

The main use case that brought me to create this issue is that it would be outstanding if we could restore a large dump while skipping copying a hypothetical logs table, e.g.:

gunzip -c some-large-dump-file.sql.gz | codd runsql --skip-copy-to public.logs

With psql or pg_restore this cannot be done, and it would speed up the scenario above by a lot.

This contrasts a little with the simplicity of codd, but if well documented I wouldn't be surprised if users end up finding it useful.

We could emulate other of the flags of psql, e.g. -1 for transaction wrapping, but only the ones that are simple enough to do.

mzabani commented 4 months ago

Coming back to this after a while it feels out of place for codd. I'll close this for now and see if user feedback ever requests it.