We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function sqlAll(sql_statement) { return new Promise((resolve, reject) => { DB.all(sql_statement, (err, rows) => { return (err) ? reject(err) : resolve(rows); }); }); } async myFunction(...) { // possibly some .js code try { const rows = await sqlAll('select * from mytable;'); catch (err) { console.error(err); } // possibly more .js code }
The text was updated successfully, but these errors were encountered:
// Parallel execution: const all_results = await Promise.all([ sqlAll(stmt1), sqlAll(stmt2), sqlAll(stmt3) ]); // Serial execution: const result1 = await sqlAll(stmt1); const result2 = await sqlAll(stmt2); const result3 = await sqlAll(stmt3);
Sorry, something went wrong.
See also https://github.com/StratoKit/strato-db/blob/master/src/DB/SQLite.js which provides a Promise API for node-sqlite3
Closing in favor of #834
No branches or pull requests
The text was updated successfully, but these errors were encountered: