简体   繁体   中英

Change sqlite file size after using SQLiteConnection.Delete(object) command with sqlite-net orm

I am working with sqlite-net ORM. First, I am using big database, file size was about 120 mb. Than I deleted small part of that database But file size is not changed.I am trying use vacuum but I can't use vacuum command. Where I should use vacuum command?

public class Entities : SQLiteConnection
{

    public Entities(string dbPath, bool createDatabase = false)
        : base(dbPath)
    {
    }
}

My SQLiteConnection is inside the SQLite.cs sqlite-net orm.

This quick way using sqlite commands using with SQLitePCL library.

public async Task<int> Vacuum()
{
     return Db.SqliteConnection.ExecuteAsync("VACUUM;");
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM