[zz]Save SQLite memory database to file

[url]http://itsystementwicklung.de/pipermail/list-pysqlite/2008-July/000113.html[/url]


I would like to do this for similar reasons. I have a web application where
the application data will be organized in a sqlite database unique to each
user. The user will upload the database when he begins a session and
download it when he is done. I want to manage the data entirely in memory
because

(a) the database size will be relatively small (on the order of a few
megabytes),

(b) there will be few users simultaneously using the system,

(c) I want the data to expire when the user's session expires (which may
occur as a timeout), so I intend to store the sqlite database in the user's
server-side session.

(d) I don't want to have to find a place to store the data on the disk,
ensure that the permissions are correct, and remove files that have expired.

So, to be specific, I don't want to load/dump the in-memory database to/from
a file, but instead to/from a stream.
It appears the API doesn't support what I'm trying to do. Do you have any
suggestions on how I might go about saving an in-memory database or
initializing from a previously-saved database without touching the file
system?

I understand I could use the aforementioned file-based technique to
accomplish what I need, but that's a clumsy way to get at the raw data, when
it presumably already exists in memory.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值