.dump feature request
.dump command first drop the table before creating it?
So, instead of
BEGIN TRANSACTION; ... CREATE TABLE xxx(s); ...
BEGIN TRANSACTION; ... DROP TABLE IF EXISTS xxx; CREATE TABLE xxx(s); ...
This is because a dump is often used to transfer changes from one database (e.g. a single table) to another, not only for a full rebuild of a database.
The way it currently works, only data can be transferred but assuming table structure is unchanged.
But if the table structure also changes, the transfer fails unless one first manually deletes the destination table before feeding the .dump output to the destination database.
I want to +1 this request, except it needs to be a switchable feature in the .dump command, maybe adding something like --drop-tables as a switch.
I sometimes do want the dump import to fail very noisily if it gets run by accident or twice in a row or as part of a database repair/upgrade etc. etc.
A switch for the less likely use case to avoid having to type it most of the time.
For me at least, the most common use (only case actually) is the drop is either required or indifferent (e.g. same table structure).
The same for views.