Skip to content

Conversation

@cianmce
Copy link
Contributor

@cianmce cianmce commented Feb 24, 2022

Following on from idea: #388

If a column name contains JSON or YAML then do the appropriate parsing and pretty-printing, if parsing fails then just return the value in a pre tag and highlight using hljs

We could also add config to explicitly enable or disable this, similar to what is done with image


Sample SQL using MySQL data source

SELECT
  'test: {"k2": "v2", "k3": {"k4": "v4"}}\ntest2: [1,2]' AS sample_yaml,
  '{"test":{"k2":"v2","k3":{"k4":"v4"}},"test2":[1,2]}' AS sample_json,
  'test_content' AS sample_text
UNION
SELECT 'invaid: yaml\nobject', '{"invalid": "json"', 'more_text'

image

@jpaulomotta
Copy link

I think this is a great idea and it would be useful on projects that I'm working on.

@cianmce
Copy link
Contributor Author

cianmce commented Nov 24, 2023

@ankane is this something you'd look at including?

@sergeyk
Copy link

sergeyk commented Mar 14, 2025

This would be incredible!

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.

4 participants