"Correct" way to create a unique index with some raw SQL
I'm attempting to create a new unique index on a
username
column, but I want it to be unique on LOWER(username)
. I have the following, and it works, but I was wondering if there is an alternative way to do this without having it all as a raw query?
11 Replies
Solution
although im not sure why there is no type-safety here, if i had to take a guess it's by design
or im stupid
SchemaModule | kysely
Documentation for kysely
Ahhh,
expression
. I was looking for something like raw
or sql
. I will give that a go later on tonight. Thank you @dechocheers man
@decho sorry it took a while, just tested it in my code and that works perfectly. Thank you again
im happy to hear that man
and no problem
š
hmm, how do I mark this as solved? š
good question
ah ha, right click the reply, Apps -> mark as solved
ah right, you have to right click a comment in this thread
yeah