Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48983

Ionic Storage - Create the DB

$
0
0

Using this API https://github.com/ionic-team/ionic-storage

when we create a database we call the following method

export const createStore = (name:string) => {
    storage = new Storage({
       name,
        driverOrder: [Drivers.IndexedDB, Drivers.LocalStorage]
    });
    storage.create();
}

So we create it and then we set it a value

createStore(“providers”)
setDB(“providers”, JSON.stringify(providers))

Once it has already been created and a value has been stored. When the application is run again to read or write to the database. Is it necessary to recreate it? I mean, use the statement createStore

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48983

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>