mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add OkPacket interface for inserts, updates, and deletes (#43938)
* add OkPacket interface for inserts, updates, and deletes * revert OkPacket member type, complete fields on OkPacket interface Co-authored-by: Sanders DeNardi <sdenardi@summusglobal.com>
This commit is contained in:
parent
bf1af1a78f
commit
5f0c754abc
25
types/mysql/index.d.ts
vendored
25
types/mysql/index.d.ts
vendored
@ -4,6 +4,7 @@
|
||||
// Kacper Polak <https://github.com/kacepe>
|
||||
// Krittanan Pingclasai <https://github.com/kpping>
|
||||
// James Munro <https://github.com/jdmunro>
|
||||
// Sanders DeNardi <https://github.com/sedenardi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
@ -667,6 +668,30 @@ export interface MysqlError extends Error {
|
||||
sqlMessage?: string;
|
||||
}
|
||||
|
||||
// Result from an insert, update, or delete statement.
|
||||
export interface OkPacket {
|
||||
fieldCount: number;
|
||||
/**
|
||||
* The number of affected rows from an insert, update, or delete statement.
|
||||
*/
|
||||
affectedRows: number;
|
||||
/**
|
||||
* The insert id after inserting a row into a table with an auto increment primary key.
|
||||
*/
|
||||
insertId: number;
|
||||
serverStatus?: number;
|
||||
warningCount?: number;
|
||||
/**
|
||||
* The server result message from an insert, update, or delete statement.
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* The number of changed rows from an update statement. "changedRows" differs from "affectedRows" in that it does not count updated rows whose values were not changed.
|
||||
*/
|
||||
changedRows: number;
|
||||
protocol41: boolean;
|
||||
}
|
||||
|
||||
export const enum Types {
|
||||
DECIMAL = 0x00, // aka DECIMAL (http://dev.mysql.com/doc/refman/5.0/en/precision-math-decimal-changes.html)
|
||||
TINY = 0x01, // aka TINYINT, 1 byte
|
||||
|
||||
Loading…
Reference in New Issue
Block a user