Ungültiger vSQL-Ausdruck (invalid-vsql-expression)

Der vSQL-Ausdruck, der bei der HTTP-Abfrage, die alle Datensätze einer LivingApp zurückliefert, als Parameter filter oder orderby übergeben wurde, ist ungültig.

Dies kann beispielsweise sein, weil eine ungültige Syntax verwendet wurde:

>>> import pprint, requests
>>> api_key = "6809fb00tDfPWbTVNvyeGxFQSFvNYSPTwZybcEQTBsSeMLwVeYZauwSKrEuuvxjqcdqygkoPoQJTJClxdUnSPhenetVXBzJeWI"
>>> response = requests.get(
...     "https://my.living-apps.de/rest/apps/5bffc841c26a4b5902b2278c/records",
...     headers={
...         "Accept" : "application/json",
...         "X-API-KEY": api_key,
...     },
...     params={
...         "filter": "now() >= ++x",
...     },
... )
>>> pprint.pprint(response.json())
{'detail': 'The vSQL expression `now() >= ++x` is invalid',
 'exception': 'antlr3.exceptions.NoViableAltException: '
              "NoViableAltException(38!=[''])",
 'expression': 'now() >= ++x',
 'status': 400,
 'title': 'Invalid vSQL expression',
 'type': 'https://my.living-apps.de/docs/REST-Service_error_invalid_vsql_expression.html'}

oder weil ein Feld angegeben wird, das nicht existiert:

>>> import pprint, requests
>>> api_key = "6809fb00tDfPWbTVNvyeGxFQSFvNYSPTwZybcEQTBsSeMLwVeYZauwSKrEuuvxjqcdqygkoPoQJTJClxdUnSPhenetVXBzJeWI"
>>> response = requests.get(
...     "https://my.living-apps.de/rest/apps/5bffc841c26a4b5902b2278c/records",
...     headers={
...         "Accept" : "application/json",
...         "X-API-KEY": api_key,
...     },
...     params={
...         "filter": "r.v_falsch.startswith('prefix')",
...     },
... )
>>> pprint.pprint(response.json())
{'cause': {'detail': 'The attribute name `v_falsch` is unknown.',
           'expression': 'r.v_falsch',
           'operation': 'Attribute access operation (`A.name`)'},
 'context': 'where',
 'detail': "The `where` vSQL expression `r.v_falsch.startswith('prefix')` is "
           'invalid',
 'exception': 'll.la.vsql.VSQLUnknownNameError',
 'root': {'expression': "r.v_falsch.startswith('prefix')",
          'operation': 'Method call (`A.name(B, ...)`)'},
 'status': 400,
 'title': 'Invalid vSQL expression',
 'type': 'https://my.living-apps.de/docs/REST-Service_error_invalid_vsql_expression.html'}

oder weil ein nicht existierendes Attribut verwendet wird:

>>> import pprint, requests
>>> api_key = "6809fb00tDfPWbTVNvyeGxFQSFvNYSPTwZybcEQTBsSeMLwVeYZauwSKrEuuvxjqcdqygkoPoQJTJClxdUnSPhenetVXBzJeWI"
>>> response = requests.get(
...     "https://my.living-apps.de/rest/apps/5bffc841c26a4b5902b2278c/records",
...     headers={
...         "Accept" : "application/json",
...         "X-API-KEY": api_key,
...     },
...     params={
...         "filter": "r.v_geburtstag.year >= today().falsch",
...     },
... )
>>> pprint.pprint(response.json())
{'cause': {'detail': 'The attribute name `falsch` is unknown.',
           'expression': 'today().falsch',
           'operation': 'Attribute access operation (`A.name`)'},
 'context': 'where',
 'detail': 'The `where` vSQL expression `r.v_geburtstag.year >= '
           'today().falsch` is invalid',
 'exception': 'll.la.vsql.VSQLUnknownNameError',
 'root': {'expression': 'r.v_geburtstag.year >= today().falsch',
          'operation': 'Greater-than or equal comparison (`A >= B`)'},
 'status': 400,
 'title': 'Invalid vSQL expression',
 'type': 'https://my.living-apps.de/docs/REST-Service_error_invalid_vsql_expression.html'}

oder weil eine Funktion mit den falschen Argumenten aufgerufen wird:

>>> import pprint, requests
>>> api_key = "6809fb00tDfPWbTVNvyeGxFQSFvNYSPTwZybcEQTBsSeMLwVeYZauwSKrEuuvxjqcdqygkoPoQJTJClxdUnSPhenetVXBzJeWI"
>>> response = requests.get(
...     "https://my.living-apps.de/rest/apps/5bffc841c26a4b5902b2278c/records",
...     headers={
...         "Accept" : "application/json",
...         "X-API-KEY": api_key,
...     },
...     params={
...         "filter": "r.v_geburtstag >= >= date(2000, 2, False)",
...     },
... )
>>> pprint.pprint(response.json())
{'cause': {'detail': 'Type combination `INT`, `INT`, `BOOL` is not supported.',
           'expression': 'date(2000, 2, False)',
           'operation': 'Function call (`name(A, ...)`)'},
 'context': 'where',
 'detail': 'The `where` vSQL expression `r.v_geburtstag >= date(2000, 2, '
           'False)` is invalid',
 'exception': 'll.la.vsql.VSQLSubnodeTypesError',
 'root': {'expression': 'r.v_geburtstag >= date(2000, 2, False)',
          'operation': 'Greater-than or equal comparison (`A >= B`)'},
 'status': 400,
 'title': 'Invalid vSQL expression',
 'type': 'https://my.living-apps.de/docs/REST-Service_error_invalid_vsql_expression.html'}