Advertisement
chrissharp123

Untitled

Dec 9th, 2019
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function insertOrReplace(schemaName, tableName, objects) {
  2.  
  3.     var info = getTableInfo(schemaName, tableName);
  4.     console.log("csharp insertOrReplace: info");
  5.     console.log(info);
  6.     if (info.error) { return Promise.reject(info.error); }
  7.  
  8.     var rows = objects.map(function(r) { return info.table.createRow(r) });
  9.     console.log("csharp insertOrReplace: rows");
  10.     console.log(rows);
  11.     return info.schema.db.insertOrReplace().into(info.table)
  12.         .values(rows).exec().then(function() { return true; });
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement