Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can we use SQLite database in PWA app

I am creating Progressive-web-app application ,I want to store user information in local device. So, how can i do this.how can I store user login information,so that he does not have to login again and again

like image 363
Palak Jain Avatar asked Feb 15 '18 12:02

Palak Jain


People also ask

Is SQLite good for mobile apps?

SQLite is very good for testing. Zero-configuration: SQLite doesn't need any complex set up to store the data. When you build Native applications with Java, it comes integrated with the platform. Developers call SQLite, a serverless database and it really lives up to the expectation.

Can PWA access local storage?

With PWA, many internet-related issues are solved. This is also one of PWA's strengths compared to the traditional website experience, which heavily relies on the network connection. In this article, we will explore some of the best practices to use PWA local storage, which enables the offline working mode.

Do Android apps use SQLite?

Android SQLite is a very lightweight database which comes with Android OS. Android SQLite combines a clean SQL interface with a very small memory footprint and decent speed. For Android, SQLite is “baked into” the Android runtime, so every Android application can create its own SQLite databases.


1 Answers

There's no SQLite for browsers, the closer you can achieve is using IndexedDB or localStorage.

I'm assuming you're using JWT or any other token authentication based tool/library, so just save that token and when the window load you'll check if the token is present and still valid, if so you can redirect the user to a desired page or let him navigate, the logic is up to you, but these are the two options you have.

Hope this helps.

like image 133
Gabriel Barreto Avatar answered Sep 20 '22 21:09

Gabriel Barreto