title: Running a SELECT * FROM table query in Pgx?
body: <p>I'm using PostgreSQL with , and I'm trying to run a SELECT * FROM query in Pgx.</p>
  <p>I can't seem to get the iteration down, as it only returns the last key in the table. I'm also trying to serve this as JSON on running the echo HTTP server library.</p>
  <p><strong>main.go function</strong> ( importing connection.Conn from my database connection file)</p>
  <pre><code>func getLanguages(c echo.Context) (err error) {
  
      Conn := connection.Conn
      type Row struct {
          Id       int
          Language string
          Name     string
      }
  
      rowArray := Row{}
  
      rows, err := Conn.Query(context.Background(), &quot;SELECT * FROM languages&quot;)
  
      defer rows.Close()
  
      // rowsCount := 0
  
      for rows.Next() {
          err := rows.Scan(&amp;rowArray.Id, &amp;rowArray.Language, &amp;rowArray.Name)
          if err != nil {
              log.Fatal(err)
          }
      }
  
      fmt.Println(rowArray)
  
      return c.JSON(http.StatusOK, rowArray)
  
  } 
  </code></pre>
  <p><strong>Expected Output</strong></p>
  <pre><code> id |  language  |        name         
  ----+------------+---------------------
    1 | none       | Plaintext
    2 | go         | Golang
    3 | python     | Python
    4 | js         | JavaScript
    5 | jsx        | React JSX
    6 | ts         | TypeScript
    7 | tsx        | React TSX
    8 | tsconfig   | TSConfig
    9 | rb         | Ruby
   10 | sql        | SQL
   11 | sol        | Solidity (Ethereum)
   12 | html       | HTML
   13 | css        | CSS
   14 | csharp     | C#
   15 | haskell    | Haskell
   16 | rust       | Rust
   17 | scala      | Scala
   18 | svg        | SVG
   19 | graphql    | GraphQL
   20 | php        | PHP
   21 | powershell | PowerShell
   22 | yaml       | YAML
   23 | json       | JSON
  </code></pre>
  <p><strong>Actual Output</strong></p>
  <pre><code>{&quot;Id&quot;:23,&quot;Language&quot;:&quot;json&quot;,&quot;Name&quot;:&quot;JSON&quot;} 
  </code></pre>
  <p>Any help?</p>