Hi All,
I am using Visual Studio Community-2017 version to do hands on CRUD operation in ionic2 and SQLite db.
I have added SQLite storage native addins into VS and now writing .ts for a dbprovider class.
I have imported SQLite and SQLiteObject but compiler can not find them. The code is like below:
dbprovider.ts
import { Injectable } from ‘@angular/core’;
import { Platform } from ‘ionic-angular’;
import { SQLite, SQLiteObject } from ‘@ionic-native/sqlite’;
export class demo {
sqllite: SQLite;
sqliteobject: SQLiteObject;
}
these two declaration giving complier error, like “Cannot find name…”
Read the docs carefully. Also think whether you can use ionic storage instead. It is much easier to work with. If you are directly dealing with SQLite, you throw away the convenience of being able to test in a browser environment.
Thanks, after reinstalling the plugins now no compile error as per your provided doc.
However now createdb method not working, there is no error and i can not see any db created.
may be i am not looking at right place.
i am using browser to test.
i am finding the db to create at www folder.
If i need to open an exiting db then , i should use openDBs() of SQLiteObject…right ?
Regarding Storage -> I believe this is only for JSON and key value pair data…correct ?