codd icon indicating copy to clipboard operation
codd copied to clipboard

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

Open mzabani opened this issue 11 months ago • 0 comments

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 avatar Mar 14 '24 19:03 mzabani