Skip to content
Discussion options

You must be logged in to vote

DuckDB represents JSON data as strings. The JSON type is really just a VARCHAR, but with a type alias, "JSON".

If you inspect the column type of the result, using columnType(index) or columnTypes(), you can read the alias field of the DuckDBType object. This can be used to distinguish JSON VARCHARs from normal VARCHARs.

JSON values are returned as JS strings; if you want to convert them to JS objects, you'll have to use JSON.parse.

The getRowsJson method converts the returned data, of any type, to JSON-compatible JS object; it doesn't convert from JSON.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jraymakers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #324 on November 01, 2025 18:46.