ResultSetHeader object in the response

update response: [
ResultSetHeader {
fieldCount: 0,
affectedRows: 0,
insertId: 0,
info: 'Rows matched: 0 Changed: 0 Warnings: 0',
serverStatus: 2,
warningStatus: 0,
changedRows: 0
},
undefined
]
update response: [
ResultSetHeader {
fieldCount: 0,
affectedRows: 0,
insertId: 0,
info: 'Rows matched: 0 Changed: 0 Warnings: 0',
serverStatus: 2,
warningStatus: 0,
changedRows: 0
},
undefined
]
Looking for a way to determine the impact of the queries I am making to the database I have console logged the abover response from an update query. My question is if there is any documentation anywhere about the ResultSetHeader object or if anybody can confirm if it is consistent?
1 Reply
Johnny B.
Johnny B.OP5mo ago
So far, using mysql the response is consistent / present on update, insert and delete queries, but not for select queries. I haven't tried any others. It seems like those 3 queries I have tested are of type MySqlRawQueryResult In the session.d.ts I found export type MySqlRawQueryResult = [ResultSetHeader, FieldPacket[]]; That led me to discover a ResultSetHeadr.d.ts file with the following content:
declare interface ResultSetHeader {
constructor: {
name: 'ResultSetHeader';
};
affectedRows: number;
fieldCount: number;
info: string;
insertId: number;
serverStatus: number;
warningStatus: number;
/**
* @deprecated
* `changedRows` is deprecated and might be removed in the future major release. Please use `affectedRows` property instead.
*/
changedRows: number;
}

export { ResultSetHeader };
declare interface ResultSetHeader {
constructor: {
name: 'ResultSetHeader';
};
affectedRows: number;
fieldCount: number;
info: string;
insertId: number;
serverStatus: number;
warningStatus: number;
/**
* @deprecated
* `changedRows` is deprecated and might be removed in the future major release. Please use `affectedRows` property instead.
*/
changedRows: number;
}

export { ResultSetHeader };
Want results from more Discord servers?
Add your server