Skip to content

Commit 53329b8

Browse files
committed
Added binlog tablemap event type definition
1 parent aa4b533 commit 53329b8

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

types/index.d.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ export type BaseBinLogEvent = {
7575
* Size of this event
7676
*/
7777
size: number;
78+
/**
79+
* Unique identifier for table that this event relates to. This ID changes when a table is altered.
80+
*/
81+
tableId: number;
7882
flags: number;
7983
useChecksum: boolean;
8084
};
@@ -107,7 +111,22 @@ export type BinLogUpdateEvent = Omit<BinLogMutationEvent, 'rows'> & {
107111
}[];
108112
};
109113

110-
export type BinLogEvent = BinLogRotationEvent | BinLogGTIDLogEvent | BinLogXidEvent | BinLogMutationEvent;
114+
export type BinLogTableMapEvent = BaseBinLogEvent & {
115+
schemaName: string;
116+
tableName: string;
117+
columnCount: number;
118+
/**
119+
* Column types for this table. This is a list of MySQL column type ids
120+
*/
121+
columnTypes: number[];
122+
};
123+
124+
export type BinLogEvent =
125+
| BinLogRotationEvent
126+
| BinLogGTIDLogEvent
127+
| BinLogXidEvent
128+
| BinLogMutationEvent
129+
| BinLogTableMapEvent;
111130

112131
// @vlasky/mysql Connection
113132
export interface MySQLConnection {

0 commit comments

Comments
 (0)