File tree 4 files changed +0
-60
lines changed
module-mongodb-storage/src/storage/implementation
module-postgres-storage/src/storage
packages/service-core/src/storage
4 files changed +0
-60
lines changed Original file line number Diff line number Diff line change @@ -36,29 +36,6 @@ export class MongoWriteCheckpointAPI implements storage.WriteCheckpointAPI {
36
36
return batchCreateCustomWriteCheckpoints ( this . db , checkpoints ) ;
37
37
}
38
38
39
- async createCustomWriteCheckpoint ( options : storage . CustomWriteCheckpointOptions ) : Promise < bigint > {
40
- if ( this . writeCheckpointMode !== storage . WriteCheckpointMode . CUSTOM ) {
41
- throw new framework . errors . ValidationError (
42
- `Creating a custom Write Checkpoint when the current Write Checkpoint mode is set to "${ this . writeCheckpointMode } "`
43
- ) ;
44
- }
45
-
46
- const { checkpoint, user_id, sync_rules_id } = options ;
47
- const doc = await this . db . custom_write_checkpoints . findOneAndUpdate (
48
- {
49
- user_id : user_id ,
50
- sync_rules_id
51
- } ,
52
- {
53
- $set : {
54
- checkpoint
55
- }
56
- } ,
57
- { upsert : true , returnDocument : 'after' }
58
- ) ;
59
- return doc ! . checkpoint ;
60
- }
61
-
62
39
async createManagedWriteCheckpoint ( checkpoint : storage . ManagedWriteCheckpointOptions ) : Promise < bigint > {
63
40
if ( this . writeCheckpointMode !== storage . WriteCheckpointMode . MANAGED ) {
64
41
throw new framework . errors . ValidationError (
Original file line number Diff line number Diff line change @@ -113,13 +113,6 @@ export class PostgresSyncRulesStorage
113
113
) ;
114
114
}
115
115
116
- createCustomWriteCheckpoint ( checkpoint : storage . BatchedCustomWriteCheckpointOptions ) : Promise < bigint > {
117
- return this . writeCheckpointAPI . createCustomWriteCheckpoint ( {
118
- ...checkpoint ,
119
- sync_rules_id : this . group_id
120
- } ) ;
121
- }
122
-
123
116
lastWriteCheckpoint ( filters : storage . SyncStorageLastWriteCheckpointFilters ) : Promise < bigint | null > {
124
117
return this . writeCheckpointAPI . lastWriteCheckpoint ( {
125
118
...filters ,
Original file line number Diff line number Diff line change @@ -30,34 +30,6 @@ export class PostgresWriteCheckpointAPI implements storage.WriteCheckpointAPI {
30
30
return batchCreateCustomWriteCheckpoints ( this . db , checkpoints ) ;
31
31
}
32
32
33
- async createCustomWriteCheckpoint ( options : storage . CustomWriteCheckpointOptions ) : Promise < bigint > {
34
- if ( this . writeCheckpointMode !== storage . WriteCheckpointMode . CUSTOM ) {
35
- throw new framework . errors . ValidationError (
36
- `Creating a custom Write Checkpoint when the current Write Checkpoint mode is set to "${ this . writeCheckpointMode } "`
37
- ) ;
38
- }
39
-
40
- const { checkpoint, user_id, sync_rules_id } = options ;
41
- const row = await this . db . sql `
42
- INSERT INTO
43
- custom_write_checkpoints (user_id, write_checkpoint, sync_rules_id)
44
- VALUES
45
- (
46
- ${ { type : 'varchar' , value : user_id } } ,
47
- ${ { type : 'int8' , value : checkpoint } } ,
48
- ${ { type : 'int4' , value : sync_rules_id } }
49
- )
50
- ON CONFLICT DO UPDATE
51
- SET
52
- write_checkpoint = EXCLUDED.write_checkpoint
53
- RETURNING
54
- *;
55
- `
56
- . decoded ( models . CustomWriteCheckpoint )
57
- . first ( ) ;
58
- return row ! . write_checkpoint ;
59
- }
60
-
61
33
async createManagedWriteCheckpoint ( checkpoint : storage . ManagedWriteCheckpointOptions ) : Promise < bigint > {
62
34
if ( this . writeCheckpointMode !== storage . WriteCheckpointMode . MANAGED ) {
63
35
throw new framework . errors . ValidationError (
Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ export interface BaseWriteCheckpointAPI {
94
94
*/
95
95
export interface SyncStorageWriteCheckpointAPI extends BaseWriteCheckpointAPI {
96
96
batchCreateCustomWriteCheckpoints ( checkpoints : BatchedCustomWriteCheckpointOptions [ ] ) : Promise < void > ;
97
- createCustomWriteCheckpoint ( checkpoint : BatchedCustomWriteCheckpointOptions ) : Promise < bigint > ;
98
97
lastWriteCheckpoint ( filters : SyncStorageLastWriteCheckpointFilters ) : Promise < bigint | null > ;
99
98
}
100
99
@@ -104,7 +103,6 @@ export interface SyncStorageWriteCheckpointAPI extends BaseWriteCheckpointAPI {
104
103
*/
105
104
export interface WriteCheckpointAPI extends BaseWriteCheckpointAPI {
106
105
batchCreateCustomWriteCheckpoints ( checkpoints : CustomWriteCheckpointOptions [ ] ) : Promise < void > ;
107
- createCustomWriteCheckpoint ( checkpoint : CustomWriteCheckpointOptions ) : Promise < bigint > ;
108
106
lastWriteCheckpoint ( filters : LastWriteCheckpointFilters ) : Promise < bigint | null > ;
109
107
110
108
watchUserWriteCheckpoint ( options : WatchUserWriteCheckpointOptions ) : AsyncIterable < WriteCheckpointResult > ;
You can’t perform that action at this time.
0 commit comments