I'm using ligdga-5.0 to parse SQL string to JSON (it will be serialize to
JSON)  to store in MongoDB ,something like this :

SQL string : SELECT col1,col2 FROM table_test
And result serialized is :

{
  "statement": {
    "sql": "SELECT col1,col2 FROM table_test\n",
    "stmt_type": "SELECT",
    "contents": {
      "distinct": "false",
      "fields": [
        {
          "expr": {
            "value": "col1"
          },
          "field_name": "col1"
        },
        {
          "expr": {
            "value": "col2"
          },
          "field_name": "col2"
        }
      ],
      "from": {
        "targets": [
          {
            "expr": {
              "value": "table_test"
            },
            "table_name": "table_test"
          }
        ]
      }
    }
  }
}


I've been store this part in MOngoDB (without 'sql' ) :

{
    "stmt_type": "SELECT",
    "contents": {
      "distinct": "false",
      "fields": [
        {
          "expr": {
            "value": "col1"
          },
          "field_name": "col1"
        },
        {
          "expr": {
            "value": "col2"
          },
          "field_name": "col2"
        }
      ],
      "from": {
        "targets": [
          {
            "expr": {
              "value": "table_test"
            },
            "table_name": "table_test"
          }
        ]
      }
    }
}

And today I want to convert this JSON to SQL string ('SELECT col1,col2
FROM table_test') . What can i do ?

Regards,
_______________________________________________
gnome-db-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gnome-db-list

Reply via email to