0

I would like to insert my Json content into my Sqlite3 database with node is, but I'm beginner and I don't know how can do this, so can someone help me Please. For the moment I have this code :

    const sqlite3 = require('sqlite3').verbose();
    let db = new sqlite3.Database('OpinakaDB.db', (err) => {
    if(err){
        return console.error(err.message);
    }
    console.log('Connextion à la bdd Sqlite réussite');

    // Affichage du contenue de la table
    db.all('SELECT * FROM opi_office', (err, data) => {
        if (err) {
            throw err;
        }
        console.log(data);
    });
    });

   db.close((err) => {
      if (err) {
          return console.error(err.message);
      }
   console.log('Fermeture de la connexion.');
   });
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.