Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#316 globaly unique but language specific index #358

Merged
merged 6 commits into from
Dec 6, 2023

Conversation

novoj
Copy link
Collaborator

@novoj novoj commented Dec 1, 2023

No description provided.

novoj added 2 commits December 1, 2023 11:05
Currently we support `uniqueGlobally` attributes, which behave as a unique index over that attribute among all entities, regardless of the locale of the attribute, if the attribute is also `localized`. In some projects we want to use this index for URL attributes, but we only store relative URLs in the database. If the locale is bound (can be derived) to the missing part of the url - the domain/hostname - the URL will be the same for multiple locale variants and thus the globally unique constraint will be broken in this situation.

We need to optionally support two `uniqueGlobally' behaviors:

- **IN_ALL_LOCALES**: current behavior
- **LOCALE_SPECIFIC**: new behavior where the database will only check for attribute uniqueness among attributes in the same locale.

The second behavior disables the functionality of the implicit locale, which can no longer be derived from the unique attribute in the filter constraint for attributes with LOCALE_SPECIFIC uniqueness - since multiple locales can match the same content of the attribute value.
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

Attention: 87 lines in your changes are missing coverage. Please review.

Comparison is base (ea2af0a) 74.85% compared to head (aecc5de) 74.91%.
Report is 7 commits behind head on dev.

❗ Current head aecc5de differs from pull request most recent head 0ea7fd6. Consider uploading reports for the commit 0ea7fd6 to get more accurate results

Files Patch % Lines
...alApi/grpc/requestResponse/EvitaEnumConverter.java 56.16% 23 Missing and 9 partials ⚠️
...uestResponse/schema/dto/GlobalAttributeSchema.java 21.42% 11 Missing ⚠️
...e/schema/builder/GlobalAttributeSchemaBuilder.java 41.66% 7 Missing ⚠️
...lator/facet/FacetSummaryOfReferenceTranslator.java 78.57% 5 Missing and 1 partial ⚠️
...schema/builder/AbstractAttributeSchemaBuilder.java 63.63% 4 Missing ⚠️
...n/attribute/ModifyAttributeSchemaNameMutation.java 0.00% 4 Missing ⚠️
...n/attribute/ModifyAttributeSchemaTypeMutation.java 25.00% 3 Missing ⚠️
...e/src/main/java/io/evitadb/index/CatalogIndex.java 0.00% 3 Missing ⚠️
.../api/requestResponse/schema/dto/CatalogSchema.java 0.00% 2 Missing ⚠️
...b/api/requestResponse/schema/dto/EntitySchema.java 0.00% 2 Missing ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #358      +/-   ##
==========================================
+ Coverage   74.85%   74.91%   +0.06%     
==========================================
  Files        1962     1957       -5     
  Lines       72366    72119     -247     
  Branches     7872     7835      -37     
==========================================
- Hits        54167    54029     -138     
+ Misses      14334    14255      -79     
+ Partials     3865     3835      -30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

lukashornych and others added 3 commits December 5, 2023 17:18
# Conflicts:
#	evita_api/src/main/java/io/evitadb/api/requestResponse/schema/dto/CatalogSchema.java
#	evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/attribute/CreateGlobalAttributeSchemaMutation.java
@novoj novoj merged commit 9c1463c into dev Dec 6, 2023
@novoj novoj deleted the 316-globaly-unique-but-language-specific-index branch December 6, 2023 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants