0

I use ionic4 + angular8 code flow:

enter image description here

Error code:

enter image description here

Please help me. Thank you.

error code in here enter image description here

2
  • webService.service.ts and storageService.service.ts are 2 files that you created right ?can you post 2 file webService.service.ts and storageService.service.ts ? Commented Feb 17, 2020 at 3:46
  • webService.service.ts和storageService.service.ts? no problem. subject matter is sqlite Commented Feb 17, 2020 at 4:42

2 Answers 2

1

You have written transaction but, I let you know that there is no property of transaction in SQLite plugin, you need to add write create property, whatever to open or create the database. like =>

this.sqlite.create({
  name: 'data.db',
  location: 'default'
})
  .then((db: SQLiteObject) => 

db.executeSql('create table danceMoves(name VARCHAR(32))', [])
  .then(() => console.log('Executed SQL'))
  .catch(e => console.log(e));
  })

  .catch(e => console.log(e));
Sign up to request clarification or add additional context in comments.

Comments

0

When you open or create db from sqlite , you should use executeSql after to execute query and take action with db. Sqlite for ionic 4 doesn't support transaction anymore. For more information and example

this.sqlite.create({
  name: 'data.db',
  location: 'default'
})
  .then((db: SQLiteObject) => {


    db.executeSql('create table danceMoves(name VARCHAR(32))', [])
      .then(() => console.log('Executed SQL'))
      .catch(e => console.log(e));


  })
  .catch(e => console.log(e));

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.