Hello, i’m trying to insert and recover the data from sqlite but a numeric
column is returning string
when inserted null
.
Create table:
db.transaction(tx => {
tx.executeSql(
'create table if not exists items (id integer primary key not null, latitude numeric, longitude numeric);'
);
});
Insert example:
db.transaction(
tx => {
tx.executeSql('insert into items (id, latitude, longitude) values (?, ?, ?)', [1, null, null]);
}
);
Select example:
db.transaction(tx => {
tx.executeSql(
'select * from items',
[],
(_, { rows: { _array } }) => console.log(_array))
);
});
My return (Latitude and longitude are string):
{id: 1, latitude: "null", longitude: "null"}
Expected return:
{id: 1, latitude: null, longitude: null}