drizzle-team / drizzle-team/drizzle-orm

[DOCS]: @deprecated The third parameter of sqliteTable is changing and will only accept an array instead of an object

Open
#4,847 1 comment 0 reactions 0 assignees View on GitHub
docs
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

The code has this block:

https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/sqlite-core/table.ts#L89C3-L110C5

```ts
/**
* @deprecated The third parameter of sqliteTable is changing and will only accept an array instead of an object
*
* @example
* Deprecated version:
* ```ts
* export const users = sqliteTable("users", {
* id: int(),
* }, (t) => ({
* idx: index('custom_name').on(t.id)
* }));
* ```
*
* New API:
* ```ts
* export const users = sqliteTable("users", {
* id: int(),
* }, (t) => [
* index('custom_name').on(t.id)
* ]);
* ```
*/
```

but it's unclear how to migrate. The example code before/after seems unclear. The "before" code has an object with an `idx` prop, and the "after" has an array with no `idx` prop anywhere. I'm not sure what `idx` is or where it is in the second example, whether it's inferred or what (or how).

I can't find dedicated docs for `sqliteTable`:

Image

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.