将现有数据库加载到内存中 sqlite3 python

时间:2021-07-21 18:25:40

标签: python sqlite

我有一个现有的数据库文件 (example.db),我需要用一些信息进一步更新。

我试过了:

# Connecting to the database file
conn = sqlite3.connect('example.db')
conn = sqlite3.connect(':memory:')
c = conn.cursor()

如果现在,我尝试从此数据库中选择表(可以说是“test”),它会抱怨没有“此类表:test”。

谁能告诉我将数据库加载到内存中的正确方法是什么?

谢谢!

0 个答案:

没有答案