Skip to content

feat: Add JSON type support to Node.js API#5

Merged
adsharma merged 1 commit intoLadybugDB:mainfrom
tobiasstrebitzer:feat/json-support
Apr 8, 2026
Merged

feat: Add JSON type support to Node.js API#5
adsharma merged 1 commit intoLadybugDB:mainfrom
tobiasstrebitzer:feat/json-support

Conversation

@tobiasstrebitzer
Copy link
Copy Markdown
Contributor

This PR adds support for the JSON logical type in the Node.js API, allowing JSON values from the database to be properly converted to JavaScript objects.

Changes Made

1. Fixed JSON Type Conversion (src_cpp/node_util.cpp)

  • Added proper JSON parsing using JSON.parse() for JSON values stored as strings

2. Added JSON Test Case (test/test_data_type.js)

  • Added comprehensive test that verifies JSON object and array conversion

Testing

  • All existing tests continue to pass
  • New JSON test passes, verifying proper object/array conversion

Impact

  • Fixes 'Unsupported type: JSON' error when querying JSON columns from Node.js
  • Enables full JSON functionality in the Node.js API

@tobiasstrebitzer tobiasstrebitzer marked this pull request as ready for review April 2, 2026 05:12
@aheev
Copy link
Copy Markdown
Contributor

aheev commented Apr 2, 2026

LGTM overall. Let's see if the tests pass. Can you please fix your tree though?

@aheev
Copy link
Copy Markdown
Contributor

aheev commented Apr 2, 2026

We might need similar fix in wasm too

@tobiasstrebitzer
Copy link
Copy Markdown
Contributor Author

LGTM overall. Let's see if the tests pass. Can you please fix your tree though?

fixed 👍

We might need similar fix in wasm too

I'll take a look at that

@adsharma adsharma merged commit 42d1f76 into LadybugDB:main Apr 8, 2026
4 checks passed
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