drizzle-team / drizzle-team/drizzle-orm
[DOCS]: Incorrect Usage of drizzle Function with Supabase and Drizzle ORM
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Enhancement hasn't been filed before.
- [X] I have verified this enhancement I'm about to request hasn't been suggested before.
### Describe the enhancement you want to request
**File:** `src/db/index.ts`
**Problem:**
The following code snippet in the setup is incorrect:
```typescript
export const db = drizzle({ client });
```
This results in the error:
```
Object literal may only specify known properties, and 'client' does not exist in type 'Sql<{}>'.ts(2353)
```
**Cause:**
The `drizzle` function expects the `client` instance to be passed directly, not wrapped in an object.
**Solution:**
Update the code to:
```typescript
export const db = drizzle(client);
```
This resolves the type error and aligns with the expected signature of the `drizzle` function.
Contributor guide
Assessment
This issue has not been assessed yet.