title: Copying data from one DB to another with node-sqlite - formatting the 'insert' statement
body: <p>I'm writing a small utility to copy data from one sqlite database file to another. Both files have the same table structure - this is entirely about moving rows from one db to another.</p>
  
  <p>My code right now:</p>
  
  <pre><code>let tables: Array&lt;string&gt; = [
          "OneTable", "AnotherTable", "DataStoredHere", "Video"
      ]
  
  tables.forEach((table) =&gt; {
      console.log(`Copying ${table} table`);
  
      sourceDB.each(`select * from ${table}`, (error, row) =&gt; {
          console.log(row);
          destDB.run(`insert into ${table} values (?)`, ...row) // this is the problem
      })
  })
  </code></pre>
  
  <p><code>row</code> here is a js object, with all the keyed data from each table. I'm certain that there's a simple way to do this that doesn't involve escaping stringified data.</p>