JSDO api error : SQL query contains illegal keyword password

Posted by Elmer Berico on 20-Mar-2017 15:08

We have an object called Employee (with 100+ field) .  I have a mobile app (developed thru Telerik Platform) that access this object through JSDO.  The client-side JSDO can access the object through an endpoint:

https://<domain-name>/rest/jsdo/selectQuery?filter=&objName=employee&_ts=149003932-5418176673-13

But it's giving me back a 500 error message 'SQL query contains illegal keyword password'.  The Employee object has a 'password' field I don't need it, I only need firstName and lastName but looking at the API log, Rollbase retrieves ALL FIELDS from the object.

My question is, is there a way for me to specify fields to retrieve in /JSDO api?  maybe through the api endpoint parameters?

All Replies

Posted by egarcia on 20-Mar-2017 16:28

Hello,

As you have found, the JSDO sends a selectQuery command to the backend.

It looks like the password field is used on the server when processing the request.

Is the password field specified in the request that goes in the HTTP request?

Perhaps, the serve code should escape the name to allow the access to the field.

Regarding the JSDO.

The JSDO does not have an option to specify the fields to retrieve.

You can submit an enhancement/idea to add this support.

If you are interested on looking further into the JSDO, you could look at the function _convertToSQLQueryString().

This function processes the filter and creates the SQL statement.

There are ways that you can define custom properties at the JSDO level and read those properties from the function to use the specified fields instead of "*".

Please let me know if you would like more information on this approach.

I hope this helps,

Edsel

Posted by Ricardo Rafols on 21-Mar-2017 06:50

Hi Elmer,

try using getPage REST API instead of selecQuery.

Documentation:

documentation.progress.com/.../

This thread is closed