https://kotlinlang.org logo
#komapper
Title
# komapper
a

Andromadus Naruto

06/07/2022, 5:00 PM
I'm using the Komapper ORM and I can't seem to find a way to configure unique columns on a field via annotations. Can anyone with experience please help me with this? Thanks.
t

Toshihiro Nakamura

06/07/2022, 8:28 PM
Komapper doesn't provide annotations for unique columns. You can add unique constraints with DDL script as follows:
Copy code
val query = QueryDsl.executeScript("alter table address add constraint city_unique unique(city)")
database.runQuery(query)
a

Andromadus Naruto

06/08/2022, 4:45 AM
Okay then. Thanks.
Any plans to add this feature?
t

Toshihiro Nakamura

06/08/2022, 8:21 AM
No plan. I do not believe it is suitable for representation in annotations.
a

Andromadus Naruto

06/08/2022, 8:33 AM
Alright then. Good to know. Thanks.
👍 1
33 Views