-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
I was trying to import data from csv file and dump it onto mysql database. That is working correctly. Now I want to resolve a promise when the execution is done for data dump.
I am using below code to do so, I tried different stuff to get into end point and placing the resolve call there, but did not work out.
Please help me how to return a promise with data dum complete.
var csvToMysql = {
import_: function (filePath, table) {
return new Promise((resolve, reject) => {
let tbl = new Tables({
input: filePath,
inputType: "csv",
db: "mysql://" + mysql.user + ":" + mysql.password + "@" + mysql.host + ":" + mysql.port +
"/" + mysql.database,
tableName: table,
errorHandler: reject,
successHandler : resolve // Is there any such option or if any other way??
});
}
}
Metadata
Metadata
Assignees
Labels
No labels