How to open a export database file?
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, php, sqlite
調査の方向性
Start with the JavaScript export and XMLHttpRequest loading snippets, then inspect how saveDb.php writes the posted data to sqlite.db. Verify that the fetched file contains the exported database bytes and that it can be passed to SQL.Database without the file error.
索引モデルが issue の本文から書いたものです。
説明
I exported the database from memory and save it on server.The next time,when i re-open the exported file via XMLHttpRequest,it said the file is not a database file.How can I re-use the saved data?
The code to export and post to server:
var data = db.export();
db.close();
$.post("saveDb.php",{
data:data
},function(result){
console.log(result);
});
On the server,I used the http_put_contents() to save the data to file "sqlite.db".
The code to load the saved db file is as below:
var xhr = new XMLHttpRequest();
xhr.open('GET', 'sqlite.db', true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
var uInt8Array = new Uint8Array(this.response);
db = new SQL.Database(uInt8Array);
//......
};
xhr.send();
Then it raise an error:Uncaught Error: file is not a database
Thank you.
- 主要言語
- JavaScript
- スター
- 13.7k
- フォーク
- 1.1k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sql-js/sql.js のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
似ている issue
-
code-quality refactoring
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100