Skip to content

Commit 71f316f

Browse files
committed
Some cleanup
1 parent 80f6c05 commit 71f316f

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

modules/module-mysql/src/replication/BinLogStream.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ AND table_type = 'BASE TABLE';`,
313313
afterReplicaId: getUuidReplicaIdentityBson(record, table.replicaIdColumns)
314314
});
315315
connection.resume();
316-
// TODO: These metrics can probably be reported in batches
317316
Metrics.getInstance().rows_replicated_total.add(1);
318317
})
319318
.on('end', async function () {
@@ -404,7 +403,6 @@ AND table_type = 'BASE TABLE';`,
404403
binLogPositionState.offset = evt.position;
405404
break;
406405
case zongji_utils.eventIsWriteMutation(evt):
407-
// TODO, can multiple tables be present?
408406
const writeTableInfo = evt.tableMap[evt.tableId];
409407
await this.writeChanges(batch, {
410408
type: storage.SaveOperationTag.INSERT,
@@ -422,7 +420,6 @@ AND table_type = 'BASE TABLE';`,
422420
});
423421
break;
424422
case zongji_utils.eventIsDeleteMutation(evt):
425-
// TODO, can multiple tables be present?
426423
const deleteTableInfo = evt.tableMap[evt.tableId];
427424
await this.writeChanges(batch, {
428425
type: storage.SaveOperationTag.DELETE,

modules/module-mysql/src/replication/zongji/zongji.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ declare module '@powersync/mysql-zongji' {
5555
};
5656

5757
export type TableMapEntry = {
58-
columnSchemas: Array<ColumnSchema>;
58+
columnSchemas: ColumnSchema[];
5959
parentSchema: string;
6060
tableName: string;
61-
columns: Array<ColumnDefinition>;
61+
columns: ColumnDefinition[];
6262
};
6363

6464
export type BaseBinLogEvent = {
@@ -96,14 +96,14 @@ declare module '@powersync/mysql-zongji' {
9696
tableId: number;
9797
numberOfColumns: number;
9898
tableMap: Record<string, TableMapEntry>;
99-
rows: Array<Record<string, any>>;
99+
rows: Record<string, any>[];
100100
};
101101

102102
export type BinLogUpdateEvent = Omit<BinLogMutationEvent, 'rows'> & {
103-
rows: Array<{
103+
rows: {
104104
before: Record<string, any>;
105105
after: Record<string, any>;
106-
}>;
106+
}[];
107107
};
108108

109109
export type BinLogEvent = BinLogRotationEvent | BinLogGTIDLogEvent | BinLogXidEvent | BinLogMutationEvent;

modules/module-mysql/src/utils/mysql_utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ export function createPool(config: types.NormalizedMySQLConnectionConfig, option
4040
cert: config.client_certificate
4141
};
4242
const hasSSLOptions = Object.values(sslOptions).some((v) => !!v);
43-
// TODO confirm if default options are fine for Powersync use case
4443
return mysql.createPool({
4544
host: config.hostname,
4645
user: config.username,
4746
password: config.password,
4847
database: config.database,
4948
ssl: hasSSLOptions ? sslOptions : undefined,
5049
supportBigNumbers: true,
51-
// dateStrings: true,
5250
timezone: 'Z', // Ensure no auto timezone manipulation of the dates occur
5351
...(options || {})
5452
});

0 commit comments

Comments
 (0)