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

RSDK-9147: Change Typescript TabularDataBySQL/MQL return type to raw BSON #401

Merged
merged 7 commits into from
Nov 1, 2024

Conversation

jckras
Copy link
Member

@jckras jckras commented Oct 30, 2024

For context: The return type of the TabularDataBySQL/MQL proto has changed to return both a list of structs, the existing return type, and also a list of bytearrays that represent BSON.

Added a required dependency to bsonfy to use the BSON library
BSON provides a deserialize() function for converting lists of byte sequences into lists of javascript objects.

Testing:
Updated the data testing input to include Date objects, as the Typescript SDK will receive date fields in this format. I added a check to ensure that Date inputs are returned as native typescript Date objects

I ensured that date fields are returned as native typescript Date objects instead of strings by running tabularDataByMQL against real tabular data on viam-dev and printed the decoded data and their types. As you can see below the date and time elements are of type "Date" (click on the photo for clarity)
Screenshot 2024-10-31 at 1 33 08 PM

@jckras jckras marked this pull request as ready for review October 30, 2024 18:20
@jckras jckras requested a review from a team as a code owner October 30, 2024 18:20
@jckras jckras requested review from stuqdog, lia-viam, njooma and purplenicole730 and removed request for lia-viam October 30, 2024 18:20
@purplenicole730
Copy link
Member

purplenicole730 commented Oct 31, 2024

Is this a breaking change?

@jckras
Copy link
Member Author

jckras commented Oct 31, 2024

Is this a breaking change?
Yes! we talked off-line about this but yes since the dates/times will be given back as native Date objects and not strings this is a breaking change

@jckras jckras merged commit fc06201 into viamrobotics:main Nov 1, 2024
3 checks passed
@jckras jckras deleted the tab4 branch November 1, 2024 15:09
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.

3 participants