我正在尝试使用 react-native-sqlite-storage 插件执行一个Sqlite
简单React-Native
的查询。根据文档,我应该将两个参数放入成功回调 1)SQLite.Transaction
和 2)SQLlite.ResultSet
但我只SQLite.Transaction
在我的示例中得到了。
let sql = "SELECT * FROM table_a;"
let params = [];
db.executeSql(sql, params,
(trans, results) => {
console.log("execute success results: " + JSON.stringify(results))
console.log("execute success transaction: " + JSON.stringify(trans))
//resolve(results);
resolve(trans);
},
(error) => {
console.log("execute error: " + error);
reject(error);
});
控制台输出
execute success results: undefined
execute success transaction: {"rows":{"length":1},"rowsAffected":0}