Skip to content

Commit

Permalink
test: print response sql metadata in ClientTest
Browse files Browse the repository at this point in the history
It will make it easy to find a problem if the test fails.
  • Loading branch information
drewdzzz committed Jan 24, 2024
1 parent bc37f33 commit 218d6d8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/ClientTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ printResponse(Response<BUFFER> &response, Data data = std::vector<UserTuple>())
" code=" << err.errcode << std::endl;
return;
}
if (response.body.metadata != std::nullopt) {
std::cout << "RESPONSE SQL METADATA:" << std::endl;
for (const auto &column : response.body.metadata->column_maps) {
std::cout << "column=" << column.field_name <<
" type=" << column.field_type <<
" collation=" << column.collation <<
" span=" << column.span <<
" is_nullable=" << column.is_nullable <<
" is_autoincrement" << column.is_autoincrement <<
std::endl;
}
}
if (response.body.data != std::nullopt) {
if (!response.body.data->decode(data)) {
std::cerr << "FAILED TO DECODE DATA" << std::endl;
Expand Down

0 comments on commit 218d6d8

Please sign in to comment.