Home | History | Annotate | Download | only in data

Lines Matching refs:db

35     private static final String DB_NAME = "dummy.db";
59 SQLiteDatabase db = getReadableDB();
60 db.beginTransaction();
61 db.endTransaction();
72 SQLiteDatabase db = getWritableDB();
73 db.beginTransaction();
77 assertFalse(PhotoDatabaseUtils.insertAlbum(db, null, null, Albums.VISIBILITY_PRIVATE,
81 assertFalse(PhotoDatabaseUtils.insertAlbum(db, null, "hello", null, accountId));
84 assertFalse(PhotoDatabaseUtils.insertAlbum(db, null, "hello",
88 assertTrue(PhotoDatabaseUtils.insertAlbum(db, PARENT_ID1, "hello",
91 long albumId = PhotoDatabaseUtils.queryAlbumIdFromParentId(db, PARENT_ID1);
94 assertTrue(PhotoDatabaseUtils.insertAlbum(db, PARENT_ID2, "hello",
97 long otherAlbumId = PhotoDatabaseUtils.queryAlbumIdFromParentId(db, PARENT_ID2);
101 assertTrue(PhotoDatabaseUtils.insertAlbum(db, otherAlbumId, "hello",
105 assertFalse(PhotoDatabaseUtils.insertAlbum(db, otherAlbumId, "hello",
108 db.endTransaction();
113 SQLiteDatabase db = getWritableDB();
114 db.beginTransaction();
123 assertFalse(PhotoDatabaseUtils.insertPhoto(db, width, height, dateTaken, null, null,
127 assertFalse(PhotoDatabaseUtils.insertPhoto(db, null, height, dateTaken, null, mimeType,
131 assertFalse(PhotoDatabaseUtils.insertPhoto(db, width, null, dateTaken, null, mimeType,
135 assertFalse(PhotoDatabaseUtils.insertPhoto(db, width, height, null, null, mimeType,
139 assertFalse(PhotoDatabaseUtils.insertPhoto(db, width, height, dateTaken, null,
143 assertTrue(PhotoDatabaseUtils.insertPhoto(db, width, height, dateTaken, null, mimeType,
146 db.endTransaction();
151 SQLiteDatabase db = getWritableDB();
152 db.beginTransaction();
155 PhotoDatabaseUtils.insertPhoto(db, 100, 100, 100L, PARENT_ID1, mimeType, 100L);
156 long photoId = PhotoDatabaseUtils.queryPhotoIdFromAlbumId(db, PARENT_ID1);
159 assertFalse(PhotoDatabaseUtils.insertMetadata(db, null, "foo", "bar"));
162 assertTrue(PhotoDatabaseUtils.insertMetadata(db, photoId, "foo", "bar"));
165 assertFalse(PhotoDatabaseUtils.insertMetadata(db, photoId, "foo", "baz"));
167 db.endTransaction();
172 SQLiteDatabase db = getWritableDB();
173 db.beginTransaction();
175 assertFalse(PhotoDatabaseUtils.insertAccount(db, null));
176 assertTrue(PhotoDatabaseUtils.insertAccount(db, "hello"));
177 assertTrue(PhotoDatabaseUtils.insertAccount(db, "hello"));
179 db.endTransaction();
184 SQLiteDatabase db = getWritableDB();
185 db.beginTransaction();
187 assertTrue(PhotoDatabaseUtils.insertAccount(db, "Hello"));
188 assertTrue(PhotoDatabaseUtils.insertAlbum(db, PARENT_ID1, "hello",
191 assertTrue(PhotoDatabaseUtils.insertPhoto(db, 100, 100, 100L, PARENT_ID1, mimeType,
194 assertTrue(PhotoDatabaseUtils.insertMetadata(db, 100L, "foo", "bar"));
195 db.setTransactionSuccessful();
197 db.endTransaction();
202 db = getReadableDB();
203 assertEquals(0, DatabaseUtils.queryNumEntries(db, Accounts.TABLE));
204 assertEquals(0, DatabaseUtils.queryNumEntries(db, Photos.TABLE));
205 assertEquals(0, DatabaseUtils.queryNumEntries(db, Albums.TABLE));
206 assertEquals(0, DatabaseUtils.queryNumEntries(db, Metadata.TABLE));
218 SQLiteDatabase db = getReadableDB();
219 Cursor cursor = db.query(table, projection, null, null, null, null, null);