title: Why doesn't this sqlite query in a nested for loop return more than 1 result?
body: <p>anyone could please help me figure this out? I am new to Swift and sqlite.</p>
  <p>I am passing this  string to a function</p>
  <pre><code>let compositionstring = &quot;iris, magenta, iris&quot;;
  </code></pre>
  <p>Where I convert it to an array with</p>
  <pre><code>let compositionArr = string.components(separatedBy: &quot;,&quot;)
  </code></pre>
  <p>Then I am expecting the following code to query a database and print the path, filename, and category for each in compositionstring.</p>
  <pre><code>       do {
          try compositionArr.forEach {
              print($0)
              
              for var files in try db.prepare(files.select(path, name, category).filter(category.like($0)).limit(1)) {
                  print(&quot;path: \(files[path]), filename: \(files[name]), category: \(files[category])&quot;)
  
              }
  
          }
  </code></pre>
  <p>But I only get the first result, and nothing after.</p>
  <p>iris</p>
  <p>path: file://localhost/Volumes/IWL%20Jen%20Vid/IWL%20Captions/Material_Sonia/Sonia%202019/IWL%20videos/Mexico/Palacio%20belle%20arte/IMG_7762.MOV, filename: IMG_7762.MOV, category: Iris</p>
  <p>magenta</p>
  <p>iris</p>
  <p>There must be something very basic I am missing. Thank you for your help!</p>