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
- :memory: a_new_path.db
- 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
Post a Comment