hankinsoft / SQLPro

SQLPro bug & features tracking.
100 stars 27 forks source link

Import JSON files with nested fields #925

Closed gabriel-r closed 1 month ago

gabriel-r commented 11 months ago

The new JSON import works well for "flat" JSON files. Even very large files seems are parsed nicely and fast. However, the import will only convert the root level elements, while nested fields are imported as text.

Add support for nested JSON fields to support the any generic JSON documents exports.

For example, this JSON content:

[
  {
    "documentation": "For region ap-south-1",
    "expect": {
      "endpoint": {
        "url": "https://appstream2-fips.ap-south-1.api.aws"
      }
    },
    "params": {
      "UseDualStack": true,
      "UseFIPS": true,
      "Region": "ap-south-1"
    }
  },
  {
    "documentation": "For region ap-south-2",
    "expect": {
      "endpoint": {
        "url": "https://appstream2-fips.ap-south-1.amazonaws.com"
      }
    },
    "params": {
      "UseDualStack": false,
      "UseFIPS": true,
      "Region": "ap-south-1"
    }
  }
]

Should result in column names like:

Screenshot 2023-12-20 at 15 44 31 Untitled@2x

"documentation","expect.endpoint.url","params.UseDualStack","params.UseFIPS","params.Region"
"For region ap-south-1","https://appstream2-fips.ap-south-1.api.aws",true,true,"ap-south-1"
"For region ap-south-2","https://appstream2-fips.ap-south-1.amazonaws.com",false,true,"ap-south-1"

Originally posted by @gabriel-r in https://github.com/hankinsoft/SQLPro/issues/924#issuecomment-1671054289

hankinsoft commented 1 month ago

No plans for this at the moment. If enough users request support for nested fields, I'll re-evaluate support for them.