python - Changing the file name of a Sqlite3 database connection, while keeping keeping entire data -


i have like....:

conn = sqlite3.connect(db_path) ... ... conn.close() 

my db_path ":memory:" or real path, how change "newfile.db" while keeping of data work.

in short need go from

  1. :memory: a_new_path.db
  2. old_path.db new_path.db

i know they're both 1 in same.....

anyways, have no clue. skimmed through docs, without luck. maybe missed something.

i don't know if helps, i'm trying implement file menu functions: open new(:memory:), open existing(existing file), save , save as.

you cannot change file name of database.

python's built-in database api not have mechanism copy databases; have copy file itself, not possible in-memory databases.

if use apsw instead, can use backup api.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -