Ionic-framework: No provider for SQLite

Created on 19 Apr 2017  Â·  9Comments  Â·  Source: ionic-team/ionic-framework

Ionic version: (check one with "x")
ionic -3.0.1
Ionic App Scripts: 1.3.0
Angular Core: 4.0.0
Angular Compiler CLI: 4.0.0
Node: 7.5.0
OS Platform: Linux 4.4

I follow all instructions form main ionic website i.e https://ionicframework.com/docs/native/sqlite/

but still i get error "No providers for SQLite"

Related code:
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));
  • -

Most helpful comment

@mst1903 Put into providers in app.module.ts the SQLite provider. How to add each provider is mentioned here: https://ionicframework.com/docs/native/.

All 9 comments

Hello! Thanks for opening an issue with us! As this seems like more of a support question I will urge that you ask this question on our forum or on our slack channel. Thanks for using Ionic!

I have the same problem. I don't think it's support question but most probably a regression after ionic-native update.

Ya It works for me. Actually i forget to import dependency in ngModule
array of app.module.ts.

Thank You
Chamle Rahul

On Fri, Apr 21, 2017 at 12:04 AM, matejuh notifications@github.com wrote:

I have the same problem. I don't think it's support question but most
probably a regression after ionic-native update.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/driftyco/ionic/issues/11270#issuecomment-295848883,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AM7HUkD3e2FCp5Zf5BnX9vCj16Ux4N4cks5rx6UrgaJpZM4NBogL
.

I have the same problem, what's the solution? @RahulChamle what import dependency do you mean? In the instructions (https://ionicframework.com/docs/native/sqlite/) there is nothing about an import dependency?!

@mst1903 Put into providers in app.module.ts the SQLite provider. How to add each provider is mentioned here: https://ionicframework.com/docs/native/.

hello guys whats the directory ?

In the app.module.ts, Add 'SQLite' in the Provider section like below and import {SQLite} from '@ionic-native/sqlite'. Hope it should resolve the issue
providers: [
StatusBar,
SplashScreen,
Camera,
SQLite
]

Adding SQLite in the Provider, salving my day!

Thanks guys

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GeorgeAnanthSoosai picture GeorgeAnanthSoosai  Â·  3Comments

Nick-The-Uncharted picture Nick-The-Uncharted  Â·  3Comments

daveshirman picture daveshirman  Â·  3Comments

brandyscarney picture brandyscarney  Â·  3Comments

SebastianGiro picture SebastianGiro  Â·  3Comments