Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用replaceUnique返回类型为ReaderT backend m (Maybe (Unique record)). 我的数据库表有两个唯一字段,如果违反唯一性,我想找出哪个键冲突。我怎样才能做到这一点?
replaceUnique
ReaderT backend m (Maybe (Unique record))
这可以通过以下代码实现:
case unique of UniqueEmail _ -> -- email is conflicting UniqueDisplayName _ -> -- displayName is conflicting
其中uniqueisUnique record和是唯一UniqueEmail _性UniqueDisplayName _约束。
unique
Unique record
UniqueEmail _
UniqueDisplayName _