{'name': 'successCallback', 'type': types_.FUNCTION},
{'name': 'errorCallback', 'type': types_.FUNCTION, optional: true, nullable: true},
{'name': 'page', 'type': types_.LONG, optional: true},
- {'name': 'maxNumberPerPage', 'type': types_.LONG, optional: true}
+ {'name': 'maxNumberPerPage', 'type': types_.LONG, optional: true},
+ {'name': 'order', 'type': types_.STRING, optional: true, nullable: true}
]);
var nativeParam = {
if (args['maxNumberPerPage']) {
nativeParam['maxNumberPerPage'] = args.maxNumberPerPage;
}
+ if (args['order']) {
+ nativeParam['order'] = args.order;
+ }
+
try {
var syncResult =
callNativeWithCallback('SQLDataControlConsumer_select', nativeParam, function(result) {
static_cast<int>(args.get("maxNumberPerPage").get<double>());
}
+ char* order = nullptr;
+ if (args.contains("order")) {
+ order = const_cast<char*>(args.get("order").get<std::string>().c_str());
+ }
+
int result = RunSQLDataControlJob(providerId, dataId, callbackId, reqId,
- [&columns, &where, page, maxNumberPerPage](
+ [&columns, &where, order, page, maxNumberPerPage](
data_control_h& handle,
int *requestId) -> int {
LoggerD("Enter");
if (page > 0 && maxNumberPerPage > 0) {
return ::data_control_sql_select_with_page(handle, cColumns,
columnCount, where.c_str(),
- "1 ASC", page,
+ order, page,
maxNumberPerPage, requestId);
} else {
return ::data_control_sql_select(handle, cColumns, columnCount,
- where.c_str(), "1 ASC", requestId);
+ where.c_str(), order, requestId);
}
});