4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Adobe AIR の SQLite データサイズ最適化

Posted at

概要

Adobe AIR では、SQLite が扱えます。
DB データ容量が増えた後にデータ削除してもデータファイルサイズは減りません。(バグではなく仕様です。)
これを明示的にデータ容量を最適化する方法です。
SQLite のコマンドとしては、VACUUM というものがあるようなのですが、それは使えなかったので。

コード

SQLConnection に compact というメソッドがあるので、使用します。以下のような感じ。

as3
var dbfile:File = File.documentsDirectory.resolvePath("data.db");
var conn = new SQLConnection();
conn.open(dbfile);

//容量最適化
conn.compact();
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?