I'm creating and using two tables that both work perfectly on iOS, but only one of them works on Android.
This one works perfectly:
const createEntriesTable = () => {
const query = `
CREATE TABLE IF NOT EXISTS entries (
id TEXT PRIMARY KEY,
entry TEXT NOT NULL,
category TEXT NOT NULL,
source TEXT NOT NULL)
`;
db.executeSql(
query,
err => {
console.log('Create entries Error: ' + err.message);
},
() => {
console.log('Entries table OK');
fetchEntries();
}
);
};
This one doesn't work
const createSettingsTable = () => {
const user = window.device.uuid;
const query = `
CREATE TABLE IF NOT EXISTS settings (
user TEXT PRIMARY KEY,
theme TEXT,
language TEXT,
voice TEXT)
`;
db.transaction(tx => {
tx.executeSql(
query,
err => {
console.log('Create settings Error: ' + err.message);
},
() => {
console.log('Settings table OK');
}
);
tx.executeSql(
`SELECT * FROM settings WHERE user = '${user}'`,
[],
res => {
console.log('User found OK');
if (res.rows.length < 1) {
initUser(user);
} else {
fetchSettings();
}
},
err => console.log(err.message)
);
});
};
I see the console logs that tell me the tables were created "ok", but when I try to update something in the settings table, I get the 'no such table settings' error.
I'm creating and using two tables that both work perfectly on iOS, but only one of them works on Android.
This one works perfectly:
This one doesn't work
I see the console logs that tell me the tables were created "ok", but when I try to update something in the settings table, I get the 'no such table settings' error.
Any thoughts?