SQLPro icon indicating copy to clipboard operation
SQLPro copied to clipboard

Import JSON files with nested fields

Open gabriel-r opened this issue 2 years ago • 0 comments

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

gabriel-r avatar Aug 09 '23 10:08 gabriel-r