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

json-api: "table scan"-style query, literal equality and record subsets #2826

Merged
merged 54 commits into from Sep 23, 2019

Conversation

S11001001
Copy link
Contributor

@S11001001 S11001001 commented Sep 9, 2019

Fixes #2778 .

Pull Request Checklist

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@S11001001 S11001001 added this to the HTTP JSON API Query milestone Sep 9, 2019
@S11001001 S11001001 self-assigned this Sep 9, 2019
S11001001 and others added 27 commits September 9, 2019 16:43
- false cases fail because outer layer still stubbed
- deals with potential subst introduction as we make VP more abstract
Copy link
Contributor

@leo-da leo-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

JSON are also always interpreted with respect to some specified LF types
(e.g. template IDs). As #2777 implies, for example::

{"%templates": [{"moduleName": "Foo", "entityName": "A"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking about this... Maybe %templates should NOT be an Array? In this case if typecheck fails, it will be clear what Template it failed for. I bet we can improve the error reporting and maybe it already provides all required information, but it just looks strange to me that we may return totally unrelated types in one result set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it helps, you can think of the result type as a list of values of variant type, where the variant data constructor is a template ID rather than a string or int. If it does not help, well, we can reconsider elsewhere.


A JSON object, when considered with a record type, is always interpreted
as a field equality query. Its type context is thus mutually exclusive
with `the forthcoming comparison queries
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an example here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because

  1. this is a statement that no example of x exists, and
  2. to exemplify indirectly (e.g. by saying "this is always left, and this is always right", though I am skeptical of the value of such an inclusion) would require the full definition of comparison queries as meaningful context, which does not belong in this document until json-api: comparison query #2780.

Copy link
Contributor

@gerolf-da gerolf-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. If not in this PR, please prioritize putting together some documentation for the JSON-API in general, and also for the query syntax.

@leo-da leo-da merged commit 22a5b17 into master Sep 23, 2019
@leo-da leo-da deleted the 2778-literal-and-field-equality-query-json-api branch September 23, 2019 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

json-api: field equality query, with nesting
3 participants