SQLite Forum

.dump feature request
Login
Could the `.dump` command first drop the table before creating it?

So, instead of 

```
BEGIN TRANSACTION;
...
CREATE TABLE xxx(s);
...
```

this:
```
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.

Thank you