Closed Felix-N closed 10 years ago
maybe this is duplicated ?
Anyway, version 0.3.3
should invoke the callback, if specified, no matter what kind of query it is ( technically even after a BEGIN TRANSACTION
and no idea what would happen ^_^ )
Is this good enough? Cheers
thanks - though i actually meant a different step.
sqlite is writing the db file to the filesystem with a delay. we're creating sqlite files on the fly and would like to process them further (zip, copy etc.) as soon as they're done.
so far i've not seen an elegant way of knowing when the writing finishes, instead of checking either for the sqlite process or if the filesize stops changing.
that's actually straight forward through the close
listener.
var db = dblite('filename');
// add the handler
db.on('close', function () {
// you can be sure the file is written
// and you can do operations on it
});
// do any operation you want
// and when you've done it ...
db.close();
That's pretty much it since the very beginning close
ensure that .exit
is performed once everything has been done before that call.
Otherwise you can use sqlite3
commands and write an .exit
manually as SQL
but you need an info
listener in that case but close will be fired/notified regardless.
Does this solve?
cheers - actually solves it perfectly. i missed the on close completely :)
currently i've not seen a practical solution to know when writing the db file finished (successfully).