I want to know how to vacuum sqlite database. I tried a syntax MANUAL VACUUM command for the whole database from command prompt:
$sqlite3 database_name "VACUUM;";
But it's giving error as:
near "database_name": syntax error.
and also AUTO VACUUM:
PRAGMA auto_vacuum = INCREMENTAL;
And tried it for a particular table as:
VACUUM table_name;
But no result.
Run the command:
if you use DB Browser for Sqlite or
open Sqlite from command prompt:
and run
You don't to specify the table name in the syntax. Only
VACUUM
works.Also, it will clean the main database only and not any attached database files.
For more info, refer to the SQLite documentation.
Give the command like this:
As a matter of fact, this is the way to do also other queries from command line: