views:

59

answers:

1

I am tracking changes made to a levels in a game. The way I currently track changes is in a sqlite database. Each level is supposed to have its own database, as just one database for all the levels would provide complications when adding and deleting levels. So for each level, I want a database that has the same name as that level. SO that changes made to level "foo" get written to database "foo". I don't need to edit the tables just the actual name of the database. I guess now that I could just use a file renaming function in python, but I would like to know if there is any way to change names from the start. Heres an example:

    connection = sqlite.connect('\database\foo.db')
    cursor = connection.cursor()

Where foo is the variable

A: 

You'll need to post some code for us to answer this completely.

You can use the ALTER TABLE command to rename the tables within your database, you can rename your sqlite db file on disk if you close it first, and you can use a variable in your python code to represent the name of the DB you're using. But you need to be more specific if you want a more specific answer.

Paul McMillan
I posted the code. Sorry for the inarticulate explanation.
Varriount