SQLite CursorWindow limit - How to avoid crash

♀尐吖头ヾ 提交于 2019-12-04 16:17:14

CursorWindow size limit is 2MB (as of now). You cannot read a single row whose size exceeds 2MB because it is not possible to put that in a Cursor.

So instead of storing the entire JSON as a single element, you can parse it and store in separate columns or tables in the database.

So that,

  1. You can leave the unwanted data in the JSON from saving in the database.
  2. You can query a part of the data (few columns) at a time so that the queried data will not cross the 2MB CursorWindow limit.

Or you can try out other Database systems, like Realm (I haven't tried it, so I'm not sure if there is any limit there).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!