Skip to content

Commit d7374e9

Browse files
committed
Refactor getParameterSets to take a ReplicationCheckpoint.
1 parent 2378e36 commit d7374e9

File tree

6 files changed

+205
-175
lines changed

6 files changed

+205
-175
lines changed

modules/module-mongodb-storage/src/storage/implementation/MongoSyncBucketStorage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export class MongoSyncBucketStorage
261261
return result!;
262262
}
263263

264-
async getParameterSets(checkpoint: utils.InternalOpId, lookups: ParameterLookup[]): Promise<SqliteJsonRow[]> {
264+
async getParameterSets(checkpoint: ReplicationCheckpoint, lookups: ParameterLookup[]): Promise<SqliteJsonRow[]> {
265265
const lookupFilter = lookups.map((lookup) => {
266266
return storage.serializeLookup(lookup);
267267
});
@@ -271,7 +271,7 @@ export class MongoSyncBucketStorage
271271
$match: {
272272
'key.g': this.group_id,
273273
lookup: { $in: lookupFilter },
274-
_id: { $lte: checkpoint }
274+
_id: { $lte: checkpoint.checkpoint }
275275
}
276276
},
277277
{

modules/module-postgres-storage/src/storage/PostgresSyncRulesStorage.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
internalToExternalOpId,
99
LastValueSink,
1010
maxLsn,
11+
ReplicationCheckpoint,
1112
storage,
1213
utils,
1314
WatchWriteCheckpointOptions
@@ -350,7 +351,7 @@ export class PostgresSyncRulesStorage
350351
}
351352

352353
async getParameterSets(
353-
checkpoint: utils.InternalOpId,
354+
checkpoint: ReplicationCheckpoint,
354355
lookups: sync_rules.ParameterLookup[]
355356
): Promise<sync_rules.SqliteJsonRow[]> {
356357
const rows = await this.db.sql`
@@ -373,7 +374,7 @@ export class PostgresSyncRulesStorage
373374
value: lookups.map((l) => storage.serializeLookupBuffer(l).toString('hex'))
374375
}}) AS FILTER
375376
)
376-
AND id <= ${{ type: 'int8', value: checkpoint }}
377+
AND id <= ${{ type: 'int8', value: checkpoint.checkpoint }}
377378
ORDER BY
378379
lookup,
379380
source_table,

0 commit comments

Comments
 (0)