title: React Native Sqlite fetch all data in Listview
body: <p>I am using this library: <a href="https://github.com/andpor/react-native-sqlite-storage" rel="noreferrer">https://github.com/andpor/react-native-sqlite-storage</a> for my react native project. </p>
  
  <p>I retrieve single row from database like this:</p>
  
  <pre><code>db.transaction((tx) =&gt; {
          tx.executeSql('SELECT * FROM user where id = 1', [], (tx, results) =&gt; {
              console.log("Query completed");
  
              var len = results.rows.length;
             if (len &gt; 0) {
                  let row = results.rows.item(0);
                  this.setState({userName: row.name});
              }
          });
      });
  
  
  return (
          &lt;View&gt;
              &lt;Text&gt;{this.state.userName}&lt;/Text&gt;
          &lt;/View&gt;
      )
  </code></pre>
  
  <p>But now i want to fetch all data from database, tell me what wrong i am doing in below code:</p>
  
  <pre><code> db.transaction((tx) =&gt; {
          tx.executeSql('SELECT * FROM user', [], (tx, results) =&gt; {
              console.log("Query completed");
  
              var len = results.rows.length;
             for (let i = 0; i &lt; len; i++) {
                  let row = results.rows.item(i);
                  this.setState({record: row.name});
              }
          });
      });
  
  
  
  
  return (
              &lt;View&gt;
                  &lt;FlatList data={this.state.record}
                            keyExtractor={(x,i) =&gt; 1}
                            renderItem={ ({item}) =&gt;
                                &lt;ListItem&gt;&lt;Text&gt;{item.name}&lt;/Text&gt;&lt;/ListItem&gt;
                            }
                  /&gt;
              &lt;/View&gt;
          )
  </code></pre>
  
  <p>can anyone guide me how can i show database data in listview.</p>