title: Bulk insert rows from an array to an sql server with golang
body: <p>I have a list of structs as follows</p>
  <pre><code>row = [
     {
        &quot;name&quot;:&lt;name1&gt;,
        &quot;age&quot; :&lt;age1&gt;,
        &quot;job&quot; :&lt;job1&gt;
     },
     {
        &quot;name&quot;:&lt;name1&gt;,
        &quot;age&quot; :&lt;age1&gt;,
        &quot;job&quot; :&lt;job1&gt;
     },
     {
        &quot;name&quot;:&lt;name1&gt;,
        &quot;age&quot; :&lt;age1&gt;,
        &quot;job&quot; :&lt;job1&gt;
     },
     etc...
  ]
  </code></pre>
  <p>I want to insert this into an SQL table. So far I was running a loop through the array and inserting each row one by one. But is there any other way by which I can insert all the rows with just one query? I know bulk insert, but my understanding is that, for bulk insert, I will have to import data from an external file. I don't want to do that. How do I use the data from this array and perform bulk insert?</p>