add setCacheSize()
authoradam <adam@megacz.com>
Thu, 5 Jul 2007 01:35:17 +0000 (01:35 +0000)
committeradam <adam@megacz.com>
Thu, 5 Jul 2007 01:35:17 +0000 (01:35 +0000)
darcs-hash:20070705013517-5007d-ee9e3c939236b4ad76524b211c6b5ca0ed0cb547.gz

src/org/ibex/mail/SqliteTable.java

index 91dcb53..f24fabf 100644 (file)
@@ -18,6 +18,15 @@ public class SqliteTable {
     private String reapTable;
     private String reapColumn;
 
     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);
     }
     public SqliteTable(String filename, String[] tables, String reapTable, String reapColumn) {
         this(filename, tables, false, reapTable, reapColumn);
     }