Added SQLiteInterface from original plugin but with some changes.