This is my method that gets the data from a SQLLIte table.
export function getProfileRecord() {
db.transaction(
tx => {
tx.executeSql('select * from profile', [], (_, { rows }) =>
{
//console.log(rows);
//console.log(rows);
console.log(rows);
}
);
},
null,
null
);
}
This returns something like below
WebSQLRows {
“_array”: Array [
Object {
“bmi”: 24.7,
“id”: 1,
“imperialgoalweight”: 154.3,
“imperialheight”: 70.9,
“imperialweight”: 176.4,
“metricgoalweight”: 70,
“metricheight”: 180,
“metricweight”: 80,
“standard”: “Metric”,
},
Object {
“bmi”: 24.7,
“id”: 2,
“imperialgoalweight”: 154.3,
“imperialheight”: 70.9,
“imperialweight”: 176.4,
“metricgoalweight”: 70,
“metricheight”: 180,
“metricweight”: 80,
“standard”: “Metric”,
},
Object {
“bmi”: 26.2,
“id”: 3,
“imperialgoalweight”: 154.3,
“imperialheight”: 70.9,
“imperialweight”: 187.4,
“metricgoalweight”: 70,
“metricheight”: 180,
“metricweight”: 85,
“standard”: “Metric”,
},
],
“length”: 3,
}
Is there any way I can convert the result set into objects ?