-1

working in qt, SQLite, I'm trying to do vacuum but I don't know how to do.

I did vacuum using db browser and it's working fine.

With QT I have JS like:

function dbGetHandle()
{
    try {
        var db = LocalStorage.openDatabaseSync("Kardex", "1.0", "Kardex", 1000000)
    } catch (err) {
        console.log("Error opening database: " + err)
    }
    return db
}

function dbUpdateflightlog( Pimmatriculation, Pdate_etape, Ppilot1, Ppilot2, Ppilot3, Pphoto1, Pphoto2, Pphoto3, Paeroport_depart, Paeroport_arrivee, Pheure_depart, Pheure_arrivee, Ptemps_bloc_etape, Prowid)
{
    var db = dbGetHandle()
    db.transaction(function (tx) {
        tx.executeSql(
                    'update flight_log set immatriculation=?, date_etape=?, pilot1=?,  pilot2=?,  pilot3=?,  photo1=?,  photo2=?,  photo3=?,  aeroport_depart=?,  aeroport_arrivee=?,  heure_depart=?, heure_arrivee=?,  temps_bloc_etape=? where rowid = ? ', [Pimmatriculation, Pdate_etape, Ppilot1, Ppilot2, Ppilot3, Pphoto1, Pphoto2, Pphoto3, Paeroport_depart, Paeroport_arrivee, Pheure_depart, Pheure_arrivee, Ptemps_bloc_etape,Prowid
}

How vaccum my flight_log table?

thank you for you help

Dmitry Sazonov
  • 8,801
  • 1
  • 35
  • 61
Philippe
  • 25
  • 1
  • 7

1 Answers1

0

vacuum is an ordinary SQL command in SQLite, thus you just execute it. It should boild down to something like

executeSql("vacuum")
Murphy
  • 3,827
  • 4
  • 21
  • 35
  • Do you expect anyone here to have a crystal ball at hand? If you don't provide details, like what exactly you tried, what failed, what error messages you got, it's unlikely you'll get help. So take the [tour](https://stackoverflow.com/tour) and read [ask] before posting any more. – Murphy Jan 13 '18 at 20:53