© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•16mo ago•
4 replies
Natan Parmigiano

[Solved] Aliasing a column

Is there any way to alias a column on a select?

I mean an actual alias on the final query..

In starting to test out the new views support (amazing btw), I noticed a "problem"..

Normally if we have colliding colum names, like for instance: users.name and posts.name, we would alias them as user_name and post_name, for example, but currently drizzle queries them as "users"."name" and "posts"."name" In the view, which, at least in SQLite, creates a view with two "name" columns (returned as name and name:1)

That creates issues when filtering and joining data..

Maybe supporting the .as() function on columns for selects in general could be useful? Instead of only supporting it on sql``?
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

[solved] Parameterized Column Selection
Drizzle TeamDTDrizzle Team / help
3y ago
[SOLVED] How to add new column?
Drizzle TeamDTDrizzle Team / help
3y ago
Adding a new column
Drizzle TeamDTDrizzle Team / help
7mo ago
Update column A with the value of column B
Drizzle TeamDTDrizzle Team / help
3y ago