How to store JSON object in SQLite database

前端 未结 5 2040
夕颜
夕颜 2020-12-04 08:29

how do I store a JSON Object in an SQLite database? What is the correct way?

one place is the blob type column. if i can convert the JSON object into byte array an

5条回答
  •  星月不相逢
    2020-12-04 08:39

    https://github.com/requery/sqlite-android allows you to query JSON fields (and arrays in them, I've tried it and am using it). Before that I was just storing JSON strings into a TEXT column. It supports FTS3, FTS4, & JSON1

    As of July 2019, it still gets version bumps every now and then, so it isn't a dead project.

    • https://www.sqlite.org/json1.html (store and query JSON documents)
    • https://www.sqlite.org/fts3.html (perform full-text searches)

提交回复
热议问题