drizzle-team / drizzle-team/drizzle-orm
[FEATURE]: column.as("alias") method
Open
enhancement
has-pr
implemented-in-beta
priority
qb/crud
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Describe what you want
currently, the `Column` type has no `as` method, so I use `column.getSQL().mapWith(column.mapFromDriverValue).as('alias')` to properly select a column with alias.
```ts
const result = await db.select({
sellerId: user.id.getSQL().mapWith(user.id.mapFromDriverValue).as('sellerId')
})
```
It would be nice to be able to just do it with:
```ts
const result = await db.select({
sellerId: user.id.as('sellerId')
})
```
Contributor guide
Assessment
This issue has not been assessed yet.