drizzle-team / drizzle-team/drizzle-orm

[BUG]: useLiveQuery is not re-triggered

Open
#3,931 2 comments 4 reactions 0 assignees View on GitHub
bug driver/expo-sqlite qb/crud
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Report hasn't been filed before.

- [X] I have verified that the bug I'm about to report hasn't been filed before.

### What version of `drizzle-orm` are you using?

0.38.3

### What version of `drizzle-kit` are you using?

0.29.1

### Other packages

_No response_

### Describe the Bug

I am building an application with `expo-sqlite` and I have a special usecase, I am using the `Apple.sharedContainer` to have access to the SQLite db (shared db across targets) - React-Native and Swift side as well.

My usecase is the following:
- A user can create a widget that will have a Button with an Intent of changing the data from the SQLite -> this is working seamlessly without issues
- The user can than open the application and the data is not updated.
If I refresh the application and re-trigger the `useLiveQuery` the data comes back and it's fresh.

I am not sure if this is a bug, but it would be great to have a mechanism that will retrigger the `select` when the component is focused or to have a method exposed to `refetch | retrigger` when `AppState` or something else have changed (Pull-to-refresh for example).

I believe this is happening because the app is placed in the background and it is receiving changes while in background so it can't update the UI.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.