Using SQLite


#1

Hi,

I need to use sqlite or tinydb in my project and don’t know how to use it.

I need to save the data and show it from the database
I now have this code

ngOnInit(){
    this.newsProvider.getnewsbycat().subscribe(
      data=>{
        console.log(data);
        
        this.articles = data;
      }, error => {
        console.log(error);
      }
    )
  }

#2

why do you need especially sqlite?

tried https://ionicframework.com/docs/storage/ yet?


#3

Because someone told me that

First of all don’t use Localstorage, the device of the user deletes it, when it needs more space, so the user could be logged out


#4

Ok, I see, I was that guy.:man_facepalming:
We are comunication over two threads…


#5

Check the docs on Storage how to use sqlite

Works fine and no issue with localstorage


#6

Just to be clear, https://ionicframework.com/docs/storage/ is NOT the same as LocalStorage.