Unclear about some shell command differences

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unclear about some shell command differences

Tony Papadimitriou
Can someone explain the behavioral differences of the following shell commands?

.backup ?DB? FILE        Backup DB (default "main") to FILE
.clone NEWDB             Clone data into NEWDB from the existing database
.save FILE               Write in-memory database into FILE

They all seem to create a new db from the db currently active.
(.backup can optionally copy an attached db but in the default case, is it different?)

Thank you.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Unclear about some shell command differences

Richard Hipp-3
On 5/24/19, Tony Papadimitriou <[hidden email]> wrote:
> Can someone explain the behavioral differences of the following shell
> commands?
>
> .backup ?DB? FILE        Backup DB (default "main") to FILE
> .clone NEWDB             Clone data into NEWDB from the existing database
> .save FILE               Write in-memory database into FILE

.backup and .save are aliases for the same command.

.clone attempts to move as much information as possible from the main
database file into a new database file, even if the main database file
is corrupt.  The ".clone" command was originally called ".repair".  I
do not recall why we created that command.

There will be a new ".recover" command in the next release (currently
available in the prerelease snapshot) which does a better job of
recovering content from a corrupt database file.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users