On 24 Jul 2009, at 2:09pm, CityDev wrote:

>  All you have to do is copy
>
> That's handy - I didn't realise that. However I suggest it's good  
> practice
> to dump and reload in these kinds of situations. I don't yet know  
> how SQLite
> works but I suspect a reload will get the physical data into a  
> better shape
> and clear out deleted items etc. Do you know where's there's  
> documentation
> on this?

There's really only one good candidate for something like this:  
dumping a database as a set of SQL commands.  If you want to convert  
'database --> commands' or 'commands --> database', and you don't want  
to write your own software to do it, you can use the sqlite3 command- 
line tool, either in interactive mode or batch mode.  Take a look at  
the '.dump' and '.read' commands in

<http://www.sqlite.org/sqlite.html>

Of course, an entire database as SQL commands can be a really big file  
but gzip/ZIPping it works wonders because there's a great deal of  
repetition in SQL commands.

But as for your need for such things ... probably not.  Unless you  
routinely create 1000 records then delete 900 of them, you're not  
saving anything by a big export/import process.  What you are doing is  
giving yourself a backup of your database which can be read by a human  
and processed by computers which are not running SQLite.  If you  
suffer a total failure of your technology this can be extremely useful  
and give you many options for restoration.  It's how I keep my SQL  
backups.  But if all goes to plan you'll never use it.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to