通过网络发送 sqlite 数据库
我有一个 sqlite 数据库,我需要通过网络传输其数据,服务器需要修改数据,然后我需要取回数据库并更新我的本地版本或用新数据库覆盖它。我该怎么做?我的同事起初想废弃数据库并只使用 .ini 文件,但这将是我们必须经常解析的数据(这是一个用户定义的计划,可以根据用户的意愿以及服务器的意愿进行更改) )。我说我们应该将整个 .db 作为二进制文件传输,让他们做他们想做的事,然后将其收回。或者 sqlite 中有没有一种方法可以将数据库转储到 .sql 文件,就像在 MySQL 中一样,以便我们可以将其作为文本传输?
还有其他解决方案吗?这是在 python 中,如果它有差异
更新:这是在运行 linux 的嵌入式平台上(除了显而易见的基础知识之外,我不确定我们拥有什么版本/内核或什么操作系统命令)
I have an sqlite database whose data I need to transfer over the network, the server needs to modify the data, and then I need to get the db back and either update my local version or overwrite it with the new db. How should I do this? My coworker at first wanted to scrap the db and just use an .ini file, but this is going to be data that we have to parse pretty frequently (it's a user defined schedule that can change at the user's will, as well as the server's). I said we should just transfer the entire .db as a binary file and let them do with it what they will and then take it back. Or is there a way in sqlite to dump the db to a .sql file like you can do in MySQL so we can transfer it as text?
Any other solutions? This is in python if it makes a difference
update: This is on an embedded platform running linux (I'm not sure what version/kernel or what OS commands we have except the basics that are obvious)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在操作系统中使用复制命令。没有理由对此过度思考。
Use the copy command in your OS. No reason to overthink this.