Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70432

SQLITE problem with create database

$
0
0

@imadaboulhouda wrote:

Hello i have problem with sqlite is not connected always show me undefined

let conn = this.sqlite.create({
      name: 'imadox.db',
    })
    console.log(conn); //undefined
    if (conn == null) throw Error('ok error created') // show me this error
    conn.then((db: any) => {
        let dbInstance = db._objectInstance;
        this.http.get('assets/medicaments.sql',{responseType:'text'}).subscribe(e=>
          {
            this.sqlitePorter.importSqlToDb(dbInstance, e)
            .then(() => alert('Imported'))
            .catch(e => alert('error on import'));
          })
      }).catch((err)=>{
        alert('error')
        console.log(err,"Erro")
      });

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70432

Trending Articles



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