Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML format support #5482

Open
1nhann opened this issue Nov 15, 2024 · 1 comment
Open

YAML format support #5482

1nhann opened this issue Nov 15, 2024 · 1 comment

Comments

@1nhann
Copy link

1nhann commented Nov 15, 2024

tl;dr

SuperDB should support YAML as an input/output format.

Details

At the time this issue is being opened, super is at commit 222ded6.

Since SuperDB does not currently support YAML, tools like yq are helpful for converting to intermediate formats to make this data available in pipelines. For instance, given this example YAML in file k8s.yaml:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi  # Request 1 Gigabyte of storage

We can turn it into JSON for ultimate processing by super via:

$ super -version
Version: v1.18.0-159-g222ded63

$ yq -o json k8s.yaml | super -Z -
{
    apiVersion: "v1",
    kind: "PersistentVolumeClaim",
    metadata: {
        name: "my-pvc"
    },
    spec: {
        accessModes: [
            "ReadWriteOnce"
        ],
        resources: {
            requests: {
                storage: "1Gi"
            }
        }
    }
}

Likewise, using JSON output as an intermediate step before using yq to turn it into YAML:

$ super -j -c 'yield {hello: "world", a:[1,2,3]}' | yq -P -oy -

hello: world
a:
  - 1
  - 2
  - 3

For initial native YAML support, a community contribution was made in #5483, but the core Dev team has declined to merge it into the project for now (more details in that PR). We'll hold this issue open to continue collect community interest to establish priority and will plan to add YAML support in the future.

@1nhann
Copy link
Author

1nhann commented Nov 15, 2024

this is my request : #5483

@philrz philrz changed the title yaml support YAML format support Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants