WriteTransaction

Functions

Link copied to clipboard
suspend fun ObjectStore.add(item: dynamic): dynamic

Adds a new item to the database using an in-line or auto-incrementing key. If an item with the same key already exists, this will fail.

suspend fun ObjectStore.add(item: dynamic, key: Key): dynamic

Adds a new item to the database using an explicit out-of-line key. If an item with the same key already exists, this will fail.

Link copied to clipboard
suspend fun ObjectStore.clear()
Link copied to clipboard
suspend fun Queryable.count(query: Key? = null): Int
Link copied to clipboard
suspend fun CursorWithValue.delete()
suspend fun ObjectStore.delete(key: Key)
Link copied to clipboard
suspend fun Queryable.get(key: Key): dynamic
Link copied to clipboard
suspend fun Queryable.getAll(query: Key? = null): Array<dynamic>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun Queryable.openCursor(query: Key? = null, direction: Cursor.Direction = Cursor.Direction.Next, cursorStart: CursorStart? = null): Flow<CursorWithValue>

suspend fun Queryable.openCursor(query: Key? = null, direction: Cursor.Direction = Cursor.Direction.Next, cursorStart: CursorStart? = null, autoContinue: Boolean): Flow<CursorWithValue>

When autoContinue is true, all values matching the query will emit automatically. It is important not to suspend in flow collection on anything other than flow operators (such as .toList).

Link copied to clipboard
suspend fun Queryable.openKeyCursor(query: Key? = null, direction: Cursor.Direction = Cursor.Direction.Next, cursorStart: CursorStart? = null): Flow<Cursor>

suspend fun Queryable.openKeyCursor(query: Key? = null, direction: Cursor.Direction = Cursor.Direction.Next, cursorStart: CursorStart? = null, autoContinue: Boolean): Flow<Cursor>

When autoContinue is true, all values matching the query will emit automatically. It is important not to suspend in flow collection on anything other than flow operators (such as .toList).

Link copied to clipboard
suspend fun ObjectStore.put(item: dynamic): dynamic

Adds an item to or updates an item in the database using an in-line or auto-incrementing key. If an item with the same key already exists, this will replace that item. Note that with auto-incrementing keys a new item will always be inserted.

suspend fun ObjectStore.put(item: dynamic, key: Key): dynamic

Adds an item to or updates an item in the database using an explicit out-of-line key. If an item with the same key already exists, this will replace that item.

Link copied to clipboard
suspend fun CursorWithValue.update(value: dynamic)