Navigation Menu

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

Querying a custom entity by url slug #81

Closed
HeyJoel opened this issue Mar 8, 2017 · 1 comment
Closed

Querying a custom entity by url slug #81

HeyJoel opened this issue Mar 8, 2017 · 1 comment
Milestone

Comments

@HeyJoel
Copy link
Member

HeyJoel commented Mar 8, 2017

A developer would like to be able to use the custom entity system to store simple key-value data, with the key being a known string ahead of time. E.g. a Content custom entity type and key values of Home, About etc. This is basically key-value storage in a similar way to a document db, and I can see the value of having this functionality. The custom entity UrlSlug property can be used as the key, but because the slug doesn't have to be unique for all custom entity types it's tricky to put an index on this table for the url slug property, and therefore we would run into scaling issues.

Some investigation is required here to think about possible applications for working in this way and whether this constitutes a better way for indexing custom entities by a string value or whether a separate key-value storage mechanism might be more appropriate (something similar to how db bound Settings work but with more flexible editing).

For now a work around is to take advantage of cached routes using GetCustomEntityRenderSummariesByDefinitionCodeQuery and then filter in code to find the correct custom entity, then use GetCustomEntityRenderSummaryByIdQuery to get more detailed info.

@HeyJoel HeyJoel added this to the 0.2 (Announcement) milestone Mar 8, 2017
@HeyJoel HeyJoel modified the milestones: Pending, 0.3 Nov 16, 2017
@HeyJoel HeyJoel modified the milestones: 0.2.1 (Planning), 0.3 Mar 6, 2018
@HeyJoel HeyJoel modified the milestones: 0.3, 0.4 Mar 20, 2018
@HeyJoel HeyJoel modified the milestones: Planning (0.5+), 0.4 Apr 16, 2018
@HeyJoel HeyJoel modified the milestones: 0.4, 0.5 Aug 1, 2018
HeyJoel added a commit that referenced this issue Oct 18, 2018
@HeyJoel
Copy link
Member Author

HeyJoel commented Oct 18, 2018

I've added GetCustomEntityRenderSummariesByUrlSlugQuery to cover this. It simply queries the database on the url slug field and I've deferred any performance work until a bit further down the line. The api will need to work this way anyway so any performance work can be done without distrupting the api surface.

@HeyJoel HeyJoel closed this as completed Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant