stackexchange-dump-to-postgres icon indicating copy to clipboard operation
stackexchange-dump-to-postgres copied to clipboard

Show confirmation prompt for dropping the table if and only if a table exists

Open rodrigo-morales-1 opened this issue 4 years ago • 0 comments

This is a feature request.

The current behavior is that a confirmation prompt is shown whenever the script is used. I think that it would be less redundant if the confirmation prompt were shown if there exists a table in the specified schema.

I think that this behavior can be changed by adding a conditional that checks if a table exists in the specified schema in the following part of the code (specifically, where choice is).

https://github.com/Networks-Learning/stackexchange-dump-to-postgres/blob/49d8358a83bb573c63c2715b122afb2fca98376c/load_into_pg.py#L391-L401

I think doing this is necessary for making the script fully scriptable since the current behavior requires the interaction of the user or some workaround for automating it.

rodrigo-morales-1 avatar Aug 24 '21 04:08 rodrigo-morales-1