dblang/src/responses.ts

23 lines
488 B
TypeScript
Raw Normal View History

2023-02-22 11:13:43 +01:00
export class readResponse extends Array{
constructor(rows:({[key: string]:any})[]){
super();
this.push(...rows);
}
}
export class writeResponse{
affectedRows: number;
constructor(affectedRows: number){
this.affectedRows = affectedRows;
}
}
export class insertResponse extends writeResponse{
insertId: number;
constructor(affectedRows: number, insertId: number){
super(affectedRows);
this.insertId = insertId;
}
}