vendredi 12 février 2016

Bulk Insert for cordovaSQLite

Is there a Bulk insert for cordovaSQLite ? I have a lot of Data, which I want to save in a sqlite Db. My code now is

var query = "INSERT INTO Card (CardId, CardSetId, FrontText, BackText, ControlType, CardLevel, IsDirty, ChangedAt, Active) VALUES (?,?,?,?,?,?,?,?,?)"; for (var i = 0; i < cardList.length; i++) {$cordovaSQLite.execute(db, query, [cardList[i].CardId, cardList[i].CardSetId, cardList[i].FrontText, cardList[i].BackText, cardList[i].ControlType, cardList[i].CardLevel, cardList[i].IsDirty, cardList[i].ChangedAt, cardList[i].Active]); }

It works but is very very slow!

Is there a way to make it faster, or do it with a bulk insert?

Thanks

Aucun commentaire:

Enregistrer un commentaire