how to make use of "auto-vacuum" ?
Moderators: gto, EgonHugeist
how to make use of "auto-vacuum" ?
Hi, friend!
I added 1k records in the test table, and then I delete the records. I found the file size of db did not decrease.
Could you tell me how to make the "auto-vacuum" work ? Thanks!
Sample follows:freemaker wrote:Could you tell me how to set "pragma autovacuum = 1|" of sqlite3 with Zeos ?
Code: Select all
var
isNewDB: boolean;
begin
isNewDB := not FileExists(ZConnection1.Database);
ZConnection1.AutoCommit := true;
ZConnection1.Connect; // will create database file if doesn't exist
if isNewDB
then begin
ZConnection1.ExecuteDirect('pragma auto_vacuum = 1');
ZConnection1.ExecuteDirect('create table test(id integer, name varchar(25))');
end;