drizzle-team / drizzle-team/drizzle-orm

[BUG]: NativeDatabase.prepareSync

Open
#4,857 1 comment 0 reactions 0 assignees View on GitHub
bug
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.44.4

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

0.31.4

### Other packages

_No response_

### Describe the Bug

Sample Code

```
// Create database instance inside component
const expo = openDatabaseSync(DB_NAME);
const db = drizzle(expo);

const getSlotList = async (
db: ExpoSQLiteDatabase
): Promise => {
try {
const slots: Array = await db
.select({
slot: slotTable.slot,
status: slotTable.status,
})
.from(slotTable)
.orderBy(slotTable.slot);

return slots;
} catch (error) {
console.log('Error fetching slot status:', error);
return null; // Return null if there's an error fetching the slot list
}
};
```

There's an intermittent error: 'NativeDatabase.prepareSync' has been rejected when performing any db transactions or query.

How to fix this?
I'm using expo react native.

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.