Well, when you put it like that :)

I might allow the user to change the name based on the game name. But there 
again, special characters.  Ideally, the functionality would allow for 
multiple databases.

I also need to figure out how to upgrade the database when I have a database 
upgrade, and maintain current data.  That is probably just a series of SQL 
commands creating temp tables and copying the new structure over.

On a slight tangent, is there a way to verify database integrity?

-----Original Message----- 
From: Simon Slavin
Sent: Tuesday, September 29, 2015 6:47 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Best Practices


On 30 Sep 2015, at 12:05am, eluken at pentarch.org wrote:

> I am using SQLite as the backend for a table-top wargame aid. One of the 
> features I am including in the aid is allowing the user to change the name 
> of the database. What would be the best way to do so? Inside the 
> filesystem? Or some feature in SQLite to copy the database to a new name? 
> Ideally, all of the data within the database will be transferred as well.

Are you absolutely sure you want your users to choose filenames ?  Do they 
know all the filename rules for the platform they're using ?  Will they try 
to include question marks, series of dots, backslashes, or other illegal 
characters ?  Will you do the testing for checking to see if there's already 
a folder or file with the name they select ?

If you're sure you want to do it, make sure the database is not open while 
you rename it, and rename it using normal file commands, not SQLite.

There is a SQLite Backup API which can be used to take a copy of the 
database under a new name.  But this is perhaps not what you want if you 
just want to rename it.

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

Reply via email to