marklogic-community / Corona

Community REST API for MarkLogic
Other
37 stars 9 forks source link

Named queries should be reusable in string syntax #70

Closed hunterhacker closed 12 years ago

hunterhacker commented 12 years ago

Issue #59 will add named queries to the structured syntax, which is trivial. This one will track adding it to the string syntax, which is a bit more complex.

One idea is that named queries can be given names containing colons (so instead of "bob" it's "foo:bob") and in that case a string syntax containing "foo:bob" will match that named query.

Rule is: No colon? Usable only with structured query. With colon? Usable also as a string query.

This is a bit better than saying "prefix X does named queries" because that assumes no overlap in named query purposes. As an app author, I could have different domains for named queries. Imagine I have things related to user ownership, queried as user:username. I could also have things related to dates, like date:today or date:may. If names include their scoping, then I don't have to worry about users with names like "may". Make sense?

I also like the colon idea because to a regular user it's simple but to a pro user there's more there. But maybe there's a better way still.

ryangrimm commented 12 years ago

Ha! I totally forgot that you opened this issue. I was working off of memory when I implemented this, glad that it meshes up.