react-native-sqlite-storage
react-native-sqlite-storage copied to clipboard
await db.transaction
//db: SQLite.SQLiteDatabase
let tx = await db.transaction((tx2 : Transaction)=>{
console.info("tx2=",tx2);
});
console.info("tx=",tx);
Expected Behavior
tx !== null && tx2 == tx
Current Behavior
tx == null && tx2 != null && tx2 != tx
and console print
18:47:10.364 tx2= SQLitePluginTransaction {db: SQLitePlugin, txlock: true, fn: ƒ, error: ƒ, success: ƒ, …} 18:47:19.259 tx= []
Possible Solution
Steps to Reproduce (for bugs)
Context
Your Environment
-
React Native SQLite Storage Version used: "react-native-sqlite-storage": "^5.0.0",
-
React Native version used: "react-native": "0.63.0",
-
Operating System and version (simulator or device): MAC OS: Darwin x64 19.4.0
-
IDE used: VSCode Version: 1.47.2 commit: 17299e413d5590b14ab0340ea477cdd86ff13daf Date: 2020-07-15T18:18:50.054Z Electron: 7.3.2 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Darwin x64 19.4.0
-
Link to your project:
Debug logs
#441 I need using await, so i can't usin callback mode
@fjqingyou did you turn on Promise mode?