private Database(SQLiteConnection conn) { _dbConnection = conn; _setKey = new SQLiteCommand("INSERT OR REPLACE INTO kvstore (key, value) VALUES (@key, @value);", _dbConnection); _deleteKey = new SQLiteCommand("DELETE FROM kvstore WHERE key=@key", _dbConnection); _getKey = new SQLiteCommand("SELECT value FROM kvstore WHERE key = @key;", _dbConnection); _insertCrash = new SQLiteCommand("INSERT OR IGNORE INTO crashreports " + "(guid, timestamp, buildtype, errorfriendly, encryptionkey, url, version) " + "VALUES " + "(@guid, @timestamp, @buildtype, @errorfriendly, @encryptionkey, @url, @version);", _dbConnection); _getAllCrashes = new SQLiteCommand("SELECT * FROM crashreports ORDER BY timestamp DESC;", _dbConnection); _getSingleCrash = new SQLiteCommand("SELECT * FROM crashreports WHERE guid=@guid", _dbConnection); _setZipFile = new SQLiteCommand("UPDATE crashreports SET ziplocation = @ziplocation WHERE guid = @guid", _dbConnection); _setUserStory = new SQLiteCommand("UPDATE crashreports SET userstory = @userstory WHERE guid = @guid", _dbConnection); _setStackTrace = new SQLiteCommand("UPDATE crashreports SET stacktrace = @stacktrace WHERE guid = @guid", _dbConnection); _getDistinctVersions = new SQLiteCommand("SELECT DISTINCT version FROM crashreports", _dbConnection); _getDistinctBuildTypes = new SQLiteCommand("SELECT DISTINCT buildtype FROM crashreports", _dbConnection); innerApi = new DatabasePrivateApi(this); }