Closed one-numan closed 8 hours ago
After Multiple Search I get something from Stack overflow Article URL : https://stackoverflow.com/questions/62456867/cannot-await-for-sqlite3-database-get-function-completion-in-node-js
Line From StackOverFlow users and Its Correct working..
Since you want to use async/await, and the node-sqlite3 (sqlite3) library does not support the Promise API, you need to use the node-sqlite (sqlite) library, which is a wrapper over sqlite3 and adds support for the Promise API. I install SQLite and get
I after Followed this Its Working.
After have Query and Still not satisfied this answer ⬆️ .
So Let's go to official NPM document of SQLite & Github's Code Snippet URL NPM URL : https://www.npmjs.com/package/sqlite Library Github URL : https://github.com/kriasoft/node-sqlite
My Issue is Resolve and Your's
Goal : I am trying Build accessing DB with raw Query and Goal is to MVC & Not used ORM
Issue : Write an Raw Quer to getting Data from SQLite3 Database But Issue I get but response is {} empty and After Some time get data in console.log
Get Request , End Point : api/v1/emp/all
db_getAll() is Function Using In Model Section , That get Data from DB
Its give Data but await is not working here...
Console Output