add setCacheSize()
[org.ibex.mail.git] / src / org / ibex / mail / SqliteTable.java
index 91dcb53..f24fabf 100644 (file)
@@ -18,6 +18,15 @@ public class SqliteTable {
     private String reapTable;
     private String reapColumn;
 
+    // check upstream: PRAGMA encoding = "UTF-8"; 
+    // create indices
+    // PRAGMA auto_vacuum=1  (can only be set before any tables are created)
+    // periodic "PRAGMA integrity_check; "?
+
+    public void setCacheSize(int kilobytes) throws SQLException {
+        conn.prepareStatement("PRAGMA cache_size="+Math.ceil(kilobytes/1.5)+";").executeUpdate();
+    }
+
     public SqliteTable(String filename, String[] tables, String reapTable, String reapColumn) {
         this(filename, tables, false, reapTable, reapColumn);
     }