Modified sql.js to treat a field with no alias differently than a with an alias. In the case of no alias, the properties of the JSON object will be assigned directly to the event object. If there is an alias then it will behave as it did previously, and place the JSON object in the event using the alias as the key. This way, a SQL like:
SELECT * as message, clientid() AS authorizedUserId FROM 'project/topic'
Problem Description
When setting up an iot function with a sql statement like:
If you send a message such as:
The event that will be sent to the handler is:
Using the same sql statement on a live AWS setup generates a message like:
Changes Made
Modified
sql.js
to treat a field with no alias differently than a with an alias. In the case of no alias, the properties of the JSON object will be assigned directly to the event object. If there is an alias then it will behave as it did previously, and place the JSON object in the event using the alias as the key. This way, a SQL like:Will still generate: