I am integrating SQLite in my ionic application. While executing the code getting following error.
ERROR Error: Uncaught (in promise): Error: a statement with no error handler failed: sqlite3_prepare_v2 failure: incomplete input Error: a statement with no error handler failed: sqlite3_prepare_v2 failure: incomplete input
my code as below.
createEncryptedDB() {
this.platform.ready().then(() => {
this.sqlite.create({
name: 'sampleDb',
location: 'default',
key: 'mypassword'
}).then((sqlObject: SQLiteObject) => {
this.db = sqlObject;
const tableList: any = [];
tableList.push(['CREATE TABLE IF NOT EXISTS TEST_DATA(kty text, kty_type varchar(30)']);
this.queryAll(tableList).then(() => {
console.log("Tables were created")
}).catch((ex) => {
return Promise.reject(ex);
});
});
});
}
public queryAll(list: any[]): Promise<any> {
return new Promise((resolve, reject) => {
try {
this.platform.ready().then(() => {
resolve();
return this.db.sqlBatch(list);
});
} catch (err) {
reject({ err: err });
}
});
Please note that we are encrypting the database. Can anybody know how to fix this?