What's the best way to read Sqlite3 directly in Browser using Javascript?

后端 未结 2 1836
小鲜肉
小鲜肉 2020-12-28 14:32

For one of our Insights platform, we plan to generate summary SQLite3 databases in the background and let it be rendered on the browser as charts. Currently, we are intendin

2条回答
  •  半阙折子戏
    2020-12-28 15:12

    I can not tell the best, but one: Write a JavaScript SQLite reader library yourself. This will be a tedious task, but I am sure it can be done. Some cool folks have done pdf.js, which is a JavaScript renderer for PDF files, which are also binary BLOB's like SQLite files are.

    You will most probably start with the FileReader API to walk thru the SQLite file, then create some in-memory representation of the content, which your chart tool can use.

    Disclaimer: You probably want to solve your initial problem with another solution, as proposed by others, but this answers your question.

提交回复
热议问题