How to make composite uniqueness constraints? #175
Unanswered
hipertracker
asked this question in
Q&A
Replies: 4 comments 5 replies
-
|
@hipertracker It's not supported currently. It seems like a popular request, so it's definitely on my radar. I imagine the API will look something like: class MyTable(Table):
name = Varchar()
address = Text()
@classmethod
def extra_constraints(cls) -> t.List[Constraint]:
return [UniqueTogether(cls.name, cls.address)]Here's an issue for it: #172 |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
any update on this feature ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Any update? |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Hi! Are here any updates? @dantownsend |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am surprised Piccolo can set only a single column to have a unique value. How to make composite unique constraints? It's a common task to have a unique index on more than one column. Is calling a raw SQL the only option at the moment?
Beta Was this translation helpful? Give feedback.
All reactions