@@ -923,6 +923,9 @@ void Connection::Async_AfterExecute(uv_work_t *req)
923
923
result->Set (String::New (" rows" ), rowArray, v8::ReadOnly);
924
924
result->Set (String::New (" outBinds" ),Undefined ());
925
925
result->Set (String::New (" rowsAffected" ), Undefined ());
926
+ result->Set (String::New (" metaData" ), Connection::GetMetaData (
927
+ executeBaton->columnNames ,
928
+ executeBaton->numCols ));
926
929
break ;
927
930
case DpiStmtBegin :
928
931
case DpiStmtDeclare :
@@ -931,13 +934,15 @@ void Connection::Async_AfterExecute(uv_work_t *req)
931
934
result->Set (String::New (" outBinds" ),Connection::GetOutBinds (executeBaton),
932
935
v8::ReadOnly);
933
936
result->Set (String::New (" rows" ), Undefined ());
937
+ result->Set (String::New (" metaData" ), Undefined ());
934
938
break ;
935
939
default :
936
940
result->Set (String::New (" rowsAffected" ),
937
941
Integer::New ((unsigned int ) executeBaton->rowsAffected ),
938
942
v8::ReadOnly);
939
943
result->Set (String::New (" outBinds" ),Undefined ());
940
944
result->Set (String::New (" rows" ), Undefined ());
945
+ result->Set (String::New (" metaData" ), Undefined ());
941
946
break ;
942
947
}
943
948
argv[1 ] = result;
@@ -953,6 +958,35 @@ void Connection::Async_AfterExecute(uv_work_t *req)
953
958
}
954
959
}
955
960
961
+ /* ****************************************************************************/
962
+ /*
963
+ DESCRIPTION
964
+ Method to populate Metadata array
965
+
966
+ PARAMETERS:
967
+ columnNames - Column Names
968
+ numCols - number of columns
969
+
970
+ RETURNS:
971
+ MetaData Handle
972
+ */
973
+ Handle<Value> Connection::GetMetaData (std::string* columnNames,
974
+ unsigned int numCols )
975
+ {
976
+ HandleScope scope;
977
+ Handle<Array> metaArray = v8::Array::New (numCols);
978
+ for (unsigned int i=0 ; i < numCols ; i++)
979
+ {
980
+ Local<Object> column = Object::New ();
981
+ column->Set (String::New (" name" ),
982
+ String::New (columnNames[i].c_str (),
983
+ (int ) columnNames[i].length ())
984
+ );
985
+ metaArray->Set (i, column);
986
+ }
987
+ return scope.Close (metaArray);
988
+ }
989
+
956
990
/* ****************************************************************************/
957
991
/*
958
992
DESCRIPTION
0 commit comments