How to open a export database file?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, php, sqlite
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- JavaScript
- Star
- 13.7k
- Fork
- 1.1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sql-js/sql.js
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Add the WebWorker API docs Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của sql-js/sql.js
Issue tương tự
-
code-quality refactoring
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100