-
Notifications
You must be signed in to change notification settings - Fork 25k
Closed
Closed
Copy link
Labels
Component: FlatListRan CommandsOne of our bots successfully processed a command.One of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.Type: QuestionIssues that are actually questions and not bug reports.Issues that are actually questions and not bug reports.
Description
I am using this library: https://github.com/andpor/react-native-sqlite-storage in my project.
I retrieve single row from database like this:
constructor(props){
super(props)
this.state={
data: []
};
db.transaction((tx) => {
tx.executeSql('SELECT * FROM table_worker', [], (tx, results) => {
console.log("Query completed");
var len = results.rows.length;
for (let i = 0; i < len; i++) {
let row = results.rows.item(i);
this.setState({worker_fname: row.worker_fname});
this.setState({worker_sname: row.worker_sname});
this.setState({worker_lname: row.worker_lname});
}
});
});
};
render() {
return (
<View>
<View>
<Text>{this.state.worker_fname}</Text>
<Text>{this.state.worker_sname}</Text>
<Text>{this.state.worker_lname}</Text>
</View>
</View>
);
}
But now i want to fetch all data from database, and pass it to flatlist.
Metadata
Metadata
Assignees
Labels
Component: FlatListRan CommandsOne of our bots successfully processed a command.One of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.Type: QuestionIssues that are actually questions and not bug reports.Issues that are actually questions and not bug reports.