跨多个sqlite db文件连接 [英] joins across multiple sqlite db files

查看:42
本文介绍了跨多个sqlite db文件连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,android 对某些设备上的文件系统空间有一些严重的限制,一旦我的 sqlite db 文件大小超过 5mb,我的应用程序就会开始给我错误,我尝试运行 vaccum 命令

hey guys android has some serious limitations with file system space on certain devices and my app starts giving me errors once my sqlite db file size grows beyond 5mb and i try to run the vaccum command

我正在考虑将我的数据跨多个 sqlite 文件分开,以将它们分解为较小的 db 文件,以便在数据过时时我可以简单地删除相应的 sqlite 文件

i am thinking to separate my data across multiple sqlite files to break them into smaller db files so that i can simply delete the appropriate sqlite file when its data becomes obselete

这样我的主 sqlite 文件就不会变得太大,而且我在做 vaccum 时不需要占用空间

that way my main sqlite file never grows too big and i dont ever need to eat up space when doing vaccum

但是我想知道是否有一种方法可以使内部联接在多个 sqlite 文件中工作(这样主数据就在我的主 sqlite 文件中),并将辅助数据拆分到不同的 sqlite 文件中

however i wanted to know if there is a way to make inner joins work across multiple sqlite files (such that the primary data is there in my main sqlite file) and secondary data split across different sqlite files

如果这在 sqlite 中是不可能的,那么我想我将不得不重新编码东西以使用 gzipped xml 文件:-(

if this isnt possible in sqlite then i guess i will have to recode stuff to work with gzipped xml files :-(

推荐答案

使用 ATTACH DATABASE 在您的 SQL 中查询多个数据库:http://www.sqlite.org/lang_attach.html

Use ATTACH DATABASE to query more than one database in your SQL: http://www.sqlite.org/lang_attach.html

这篇关于跨多个sqlite db文件连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆