drizzle-team / drizzle-team/drizzle-orm
[FEATURE]: Add `getSubqueryFields` helper to goodies
Open
enhancement
qb/crud
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Describe what you want
The `getTableColumns` helper is really useful, but an equivalent lacks for subqueries. This can easily be implemented in userland, although it feels like the kind of helper that should come with `drizzle-orm`.
Crude implementation:
```ts
export function getSubqueryFields(
query: WithSubqueryWithSelection | SubqueryWithSelection
): (typeof query)['_']['selectedFields'] {
return query[SubqueryConfig as unknown as string].selection;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.