| 13 | #include "../errors/errors.h" |
| 14 | |
| 15 | static void _ResultSet_ReplyWithPreamble |
| 16 | ( |
| 17 | ResultSet *set |
| 18 | ) { |
| 19 | if(set->column_count > 0) { |
| 20 | // prepare a response containing a header, records, and statistics |
| 21 | RedisModule_ReplyWithArray(set->ctx, 3); |
| 22 | // emit the table header using the appropriate formatter |
| 23 | set->formatter->EmitHeader(set->ctx, set->columns, |
| 24 | set->columns_record_map); |
| 25 | } else { |
| 26 | // prepare a response containing only statistics |
| 27 | RedisModule_ReplyWithArray(set->ctx, 1); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | static void _ResultSet_SetColumns |
| 32 | ( |