drizzle-team / drizzle-team/drizzle-orm
[FEATURE]: index shorthand syntax
Open
drizzle/kit
enhancement
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Describe what you want
similar to short-hand column syntax but for indexes
```ts
mySqlTable(
"table",
{
id: int().primaryKey().autoincrement(),
fooBar: int(),
},
(table) => ({
fooIndex: index().on(table.fooBar) // <-- index name optional
})
)
```
would yield (with snake_case config)
```sql
create table `table` (
`id` int not null auto_increment primary key,
`foo_bar` int,
key foo_index(`foo_bar`)
);
```
Contributor guide
Assessment
This issue has not been assessed yet.