Open rammesaran opened 1 year ago
Hi The below query is not getting called. My question is can we use db.transaction((txn) for select query?
db.transaction((txn)
Future getTotalCountInWalletRecent() async { try { final db = await initializeDB(); await db.transaction((txn) async { List<Map> results = await txn .rawQuery("SELECT count(*) as totalCount from Walletrecent"); return results; }); } catch (e, s) { FirebaseCrashLogs.logFatelError( error: e, stackTrace: s, reason: "Exception in getTotalCountInWalletRecent Method in DbFunctions.dart"); } }
By using Below Query iam able to get the response - But i am facing database lock issue:
Future getTotalCountInWalletRecent() async { try { final db = await initializeDB(); List<Map> results = await db .rawQuery("SELECT count(*) as totalCount from Walletrecent"); return results; } catch (e, s) { FirebaseCrashLogs.logFatelError( error: e, stackTrace: s, reason: "Exception in getTotalCountInWalletRecent Method in DbFunctions.dart"); } }
Kindly let me know what i am doing wrong here!!! Any help would be appreciated.
Thanks
In the first example, you might want to return the result from the transaction (the inner list returned):
return await db.transaction((txn) async { ...
instead of:
await db.transaction((txn) async { ...
Hi The below query is not getting called. My question is can we use
db.transaction((txn)
for select query?By using Below Query iam able to get the response - But i am facing database lock issue:
Kindly let me know what i am doing wrong here!!! Any help would be appreciated.
Thanks