-
Notifications
You must be signed in to change notification settings - Fork 0
Add ability to specify a unique constraint on exact and range indexes #61
Conversation
d2f695f
to
2ec1f38
Compare
0696876
to
5213aba
Compare
60ef7b5
to
aa0fb65
Compare
aa0fb65
to
f67b369
Compare
README.md
Outdated
end | ||
``` | ||
|
||
Used in combination with `except` and `only` you can specify a unique constraint on a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what circumstance would you want to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking was to show the syntax for adding a unique constraint when using except and only. So if they didn't want the other indexes, like range for ordering or match for free text search this is what it would look like.
Do you think this is unnecessary info?
README.md
Outdated
@@ -247,6 +248,49 @@ User.query("ruby") | |||
For more information on index types and their options, see the [CipherStash | |||
docs](https://docs.cipherstash.com/reference/index-types/index.html). | |||
|
|||
## Unique indexes | |||
|
|||
ActiveStash supports adding server side unique constraints on `:range` and `:exact` indexes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it might be overloading the user with unnecessary information. The only data types for which we create both a range
and an exact
index are string-ish types (string
and text
), and we only do it there because ranges on strings aren't suitable for querying. If we stick to talking about "unique fields", I think that gives the right level of context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the detail in talking about the specific range and exact indexes here.
5202ef0
to
de3091e
Compare
…ndex Add ability to specify a unique constraint on exact and range indexes
This PR updates: