package vql import ( "encoding/json" "log" "testing" ) func Test_toOrderSql(t *testing.T) { text := `{ "as": "test", "select": [ "col1", "col2" ], "from": { "as": "test", "select": [ "col1", "col2" ], "from": "table1" }, "join": "left join table2 on table1.id = table2.id", "where": { "col1": "value1", "col2": "value2", "col3": 12 } }` var builder Builder2 err := json.Unmarshal([]byte(text), &builder) if err != nil { t.Error(err) } sql, err := builder.Sql() if err != nil { t.Error(err) } log.Println(sql) }