不要怂,就是干,撸起袖子干!

Commit cae6b4dd by Andy Edwards Committed by GitHub

refactor(sqlite/query): simplify promise usage (#12157)

1 parent 303b453a
Showing with 1 additions and 3 deletions
......@@ -232,14 +232,13 @@ class Query extends AbstractQuery {
}
return new Promise(resolve => {
return new Promise((resolve, reject) => {
const columnTypes = {};
conn.serialize(() => {
const executeSql = () => {
if (sql.startsWith('-- ')) {
return resolve();
}
resolve(new Promise((resolve, reject) => {
const query = this;
// cannot use arrow function here because the function is bound to the statement
function afterExecute(executionError, results) {
......@@ -261,7 +260,6 @@ class Query extends AbstractQuery {
if (!parameters) parameters = [];
conn[method](sql, parameters, afterExecute);
}
}));
return null;
};
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!