title: Processing SQL Queries as Lazy Streams in Racket
body: <p>Language: Racket (with SQL query code/pointer)
  Libraries: db, racket/stream, racket/sequence</p>
  <p>Goal: lazily process the value of sql queries using streams in Racket.</p>
  <p>Question 1: how do you manipulate SQL query stream objects in Racket? (I can get the stream-first value of the stream but not the rest of the stream!)</p>
  <pre><code>#lang racket/base
  (require db
           racket/sequence
           racket/stream)
  
  (define db_sql_local
    (mysql-connect
     #:user &quot;&lt;my-username&gt;&quot;
     #:database &quot;&lt;my-database&gt;&quot;
     #:server &quot;&lt;my-server&gt;&quot;
     #:port &lt;my-port&gt;
     #:password &quot;&lt;my-password&gt;&quot;))
  
  ;; PROBLEM 1 HERE
  (define test-stream
    (sequence-&gt;stream
     (in-query
      chembl_sql_local
      &quot;SELECT * FROM &lt;table-name&gt;&quot;
      #:fetch +inf.0)))
  
  (stream-first test-stream)
  
  ;; stream-first of test-stream returns the first-row of the table as a '(#vector). 
  
  
  </code></pre>
  <p>Any advice or comments would be greatly appreciated - Thank you!</p>