$name = "concerto.table.query";
$db = User::get_current_db();
if (array_key_exists("db", $_POST)) {
    $workspace_id = $_POST['db'];
}
$table_name = "";
if (array_key_exists("table_name", $_POST)) {
    $table_name = $_POST['table_name'];
}
$type = "SELECT";
if (array_key_exists("type", $_POST)) {
    $type = $_POST['type'];
}
$ws = UserWorkspace::from_property(array("db_name" => $db), false);
TestSession::change_db($ws->id);
$table = Table::from_property(array("name" => $table_name), false);
$table_columns = array();
if ($table != null) {
    $table_columns = $table->get_columns();
}
$select_section = array(array("v" => 0, "w0" => "*", "c" => "*"));
$select_section = json_encode($select_section);
if (array_key_exists('select_section', $_POST)) {
    $select_section = $_POST['select_section'];
}
$select_section = json_decode($select_section);
if (array_key_exists("select_section_add", $_POST) && $_POST['select_section_add'] == 1) {
    array_push($select_section, json_decode(json_encode(array("v" => 0, "w0" => "*", "c" => "*"))));
}
$where_section = array();
$where_section = json_encode($where_section);