Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upEnhancement: traits for uniqueness #1694
Comments
This comment has been minimized.
|
Fun fact: This is from the release notes of 0.2.0, when
(We can't actually change the behavior now) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ishitatsuyuki commentedMay 15, 2018
The basic idea is that columns with uniqueness constraints are guaranteed to return exactly zero or one value.
In some code we may want to assert this for consistency, and having this also eliminates the need for a redundant LIMIT as well.
My idea is to have a
one()method to execute queries which statically requires the query to return at most one value.