(message: Message)
| 156 | // Research corner cases where parseRowData can return null values |
| 157 | // deno-lint-ignore no-explicit-any |
| 158 | export function parseRowDataMessage(message: Message): any[] { |
| 159 | const field_count = message.reader.readInt16(); |
| 160 | const row = []; |
| 161 | |
| 162 | for (let i = 0; i < field_count; i++) { |
| 163 | const col_length = message.reader.readInt32(); |
| 164 | |
| 165 | if (col_length == -1) { |
| 166 | row.push(null); |
| 167 | continue; |
| 168 | } |
| 169 | |
| 170 | // reading raw bytes here, they will be properly parsed later |
| 171 | row.push(message.reader.readBytes(col_length)); |
| 172 | } |
| 173 | |
| 174 | return row; |
| 175 | } |
| 176 | |
| 177 | export function parseRowDescriptionMessage(message: Message): RowDescription { |
| 178 | const column_count = message.reader.readInt16(); |
no test coverage detected