如何 运行 对 MBTiles 数据库进行 VACUUM?

How to run VACUUM on MBTiles database?

我正在使用 MapProxy 创建 MBTiles 数据库。使用 mapproxy-seed.exe --cleanup 删除文件后,我知道我需要 运行 真空,如 this mailing list answer:

when you remove larger blocks of tiles, you need to do a vacuum

this other mailing list answer:

SQLite does not "release memory” if you remove records, but it will re-use the space. See https://sqlite.org/lang_vacuum.html but be aware that your cache in unavailable during VACUUM.

但是我实际上如何 运行 VACUUM 过程?我是否需要使用外部管理器连接到我的 .mbtiles 数据库,或者我可以通过命令行 运行 以某种方式连接到我的 .mbtiles 数据库?

VACUUM 是一个 SQL 声明,您 运行 与任何其他 SQL 声明一样。

如果您没有任何其他机制,download 工具包和 运行:

sqlite3.exe MyMBTiles.db vacuum