[gnome-db] Need support for - GdaStatement



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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]