title: Creating Clojure vector(s) using values pulled from map(s) via keywords
body: <p>I have a Clojure vector of maps used as a lookup table:</p>
  
  <pre><code>(def data 
    [{map1},{map2},...,{nth-map}])
  </code></pre>
  
  <p>Each map in the vector contains two key/value pairs:</p>
  
  <pre><code>{:key1 "Value1", :key2 "Value2"}
  </code></pre>
  
  <p>So the entire structure looks like this:</p>
  
  <pre><code>(def data
    [{:key1 "Value1-1", :key2 "Value2-1"}, ; map1
     {:key1 "Value1-2", :key2 "Value2-2"}, ; map2
                       |
                       |
                       V
     {:key1 "Value1-n", :key2 "Value2-n"}]) ; nth-map
  </code></pre>
  
  <p>I'd like to migrate this into a database table. I already have a function that inserts values into a table row. It takes a single vector with each item in the vector representing a column in the row:</p>
  
  <pre><code>(defn insert-row [column1-value column2-value]
    (sql/with-connection (System/getenv "DATABASE_URL")
      (sql/insert-values
        :table                           ; table name
        [:column1 :column2]              ; table column names
        [column1-value column2-value]))) ; values to be inserted into row
  </code></pre>
  
  <p>What I need is a function that goes through the entire vector of maps and for each map it creates a vector of just that map's values:</p>
  
  <pre><code>[Value1 Value2]
  </code></pre>
  
  <p>I think I can use my existing database function <code>insert-row</code> as a parameter to <code>map</code>:</p>
  
  <pre><code>(map insert-row values-from-map)
  </code></pre>
  
  <p>where <code>values-from-map</code> represents an outer vector containing inner vectors (each containing its respective values) for each map in the original vector:</p>
  
  <pre><code>[[Value1-1 Value2-1]
   [Value1-2 Value2-2]
   [Value1-n Value2-n]]
  </code></pre>
  
  <p>This would take each vector created and pass it to the <code>insert-values</code> function. </p>
  
  <p>I can create a single vector containing all the values from one keyword:</p>
  
  <pre><code>user=&gt; (vec (map :key1 data))      
  ["Value1" "Value2" ... "nth=Value"]
  </code></pre>
  
  <p>How would I create an outer vector containing all the inner vectors? </p>
  
  <pre><code>[[Value1-1 Value2-1][Value1-2 Value2-2]...[Value1-n Value2-n]]
  </code></pre>