A transaction issue
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, sqlite
- Lĩnh vực
- database
Hướng nghiên cứu
The reported entry point is SQLiteObject.executeSql, using SQL.Database; start by reproducing the logged BEGIN, INSERT OR IGNORE, and COMMIT sequence. Compare the transaction behavior with the SQLite table definition and determine the expected handling of the no-active-transaction error; done means the reported sequence has a clear, verified outcome.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I just found I can't do a transaction.
LOG: 'BEGIN', []
LOG: 'INSERT OR IGNORE INTO device_model (device_sn) VALUES (?);', ['abcdefg']
LOG: 'COMMIT', []
LOG: 'executeSql error -> ', 'cannot commit - no transaction is active'
My table.
CREATE TABLE IF NOT EXISTS device_model(device_sn TEXT PRIMARY KEY ON CONFLICT REPLACE NOT NULL, status TEXT, properties TEXT);
SqliteObject class
export class SQLiteObject {
private _objectInstance;
constructor() {
this._objectInstance = new SQL.Database();
}
public executeSql(statement: string, params: any): Promise<any> {
return new Promise((resolve, reject) => {
try {
console.log(statement, params);
const st = this._objectInstance.prepare(statement, params);
const rows: Array<any> = [];
while (st.step()) {
let row = st.getAsObject();
rows.push(row);
}
st.free();
const payload = {
rows: {
item: function (i) {
return rows[i];
},
length: rows.length
},
rowsAffected: this._objectInstance.getRowsModified() || 0,
insertId: this._objectInstance.insertId || void 0
};
resolve(payload);
} catch (e) {
console.log('executeSql error -> ', e.message);
reject(e);
}
});
}
}
Did I do something wrong?
- 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