Hi all,

 

I'm currently writing some code that attempts to keep an SqLite database
file below a certain file size (the embedded PC it is running on has a
wonderful side effect that when the disk runs out of disk space, it
blue-screens Windows and you can't boot the device after that - how
helpful!).

 

When the file exceeds a certain size, I DELETE a specific number of
records, then VACUUM the file to get the size back below required
limits.  This works fine, however what happens to the VACUUM command if
there is insufficient disk space for SqLite to write out the cleaned up
copy of the database?  I assume it will fail, but the documentation
doesn't specifically say how much disk space is required during a VACUUM
operation.  The newly vacuumed file's size should end up being equal to
or less than the existing file's size, so I assume I'll need at least
the current database's size of disk space free, but will it ever require
more space than that to perform the VACUUM (e.g. from other temporary
files)?

 

Also, is there any SqLite command I can use to get the database file's
size?  I'm currently using the Win32 API call GetFileSizeEx() to get the
file's size which works fine, but does SqLite itself know the database
file's size when it has the database open?  It would seem more
gracefully coded if I didn't have to open a separate handle to the
database file just to get the file size out.

 

Thanks,

Nick.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to