I have a simple C++ function which is executing fine in the standalone c++ 
program. However, the same function, if I embed into the node js as an 
addon, I am getting the error ": Cannot find field." I am not sure how the 
node js environment will affect the JsonStringToMessage function.

The protocol buffer is available here: 
https://github.com/googleapis/googleapis/blob/master/google/spanner/v1/spanner.proto
 


void ExecuteStreamingSql_temp()
{
    const char *cmdStr="{\"sql\":\"SELECT async_function_id FROM 
async_function WHERE execution_status_code IN 
('1','4')\",\"queryMode\":0,\"session\":null,\"params\":{}}";




    grpc::ClientContext context;
    google::spanner::v1::ExecuteSqlRequest spanreq;
    google::spanner::v1::PartialResultSet spanres;


    cout<<"*** ExecuteStreamingSql  command is = "<<cmdStr<<endl;


    cout<<"*** String length = "<<strlen(cmdStr)<<endl;




    google::protobuf::util::Status lreqstatus = google::protobuf::util::
JsonStringToMessage(cmdStr,&spanreq);


    if(!lreqstatus.ok()) {
        cout<<"ERROR while parsing = "<< lreqstatus.error_message()<<endl;
        return;
    }




    cout<<"sql is = "<<spanreq.sql()<<endl;
    return;
}

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to