© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
DT
Drizzle Team
•
3y ago
•
5 replies
micaww
Is there a way to declare a custom SQL index?
I
'm trying to create an index on the lowercase value of a column using Postgres
.
I tried
unique
().
on
(
sql
`lower(${
table
.
username
}::text)`
)
unique
().
on
(
sql
`lower(${
table
.
username
}::text)`
)
but
"on
" only accepts columns
Drizzle Team
Join
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
is there a way to use custom functions without raw sql?
DT
Drizzle Team / help
16mo ago
Is there a way to define "nullable" types for magic SQL?
DT
Drizzle Team / help
2y ago
Is there a way to set the index operator type for postgres?
DT
Drizzle Team / help
3y ago
How to set opclass for index with custom sql column
DT
Drizzle Team / help
15mo ago