@powersync/service-module-mysql 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @powersync/service-module-mysql
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 436eee6: Minor optimizations to new checkpoint calulations.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [436eee6]
12
+ - Updated dependencies [15283d4]
13
+ - Updated dependencies [88d4cb3]
14
+ - Updated dependencies [f55e36a]
15
+ - @powersync/service-core@1.7.0
16
+ - @powersync/service-sync-rules@0.24.0
17
+ - @powersync/lib-services-framework@0.5.2
18
+
3
19
  ## 0.3.1
4
20
 
5
21
  ### Patch Changes
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@powersync/service-module-mysql",
3
3
  "repository": "https://github.com/powersync-ja/powersync-service",
4
4
  "types": "dist/index.d.ts",
5
- "version": "0.3.1",
5
+ "version": "0.4.0",
6
6
  "license": "FSL-1.1-Apache-2.0",
7
7
  "main": "dist/index.js",
8
8
  "type": "module",
@@ -29,9 +29,9 @@
29
29
  "ts-codec": "^1.3.0",
30
30
  "uri-js": "^4.4.1",
31
31
  "uuid": "^9.0.1",
32
- "@powersync/lib-services-framework": "0.5.1",
33
- "@powersync/service-core": "0.18.1",
34
- "@powersync/service-sync-rules": "0.23.4",
32
+ "@powersync/lib-services-framework": "0.5.2",
33
+ "@powersync/service-core": "1.7.0",
34
+ "@powersync/service-sync-rules": "0.24.0",
35
35
  "@powersync/service-types": "0.8.0",
36
36
  "@powersync/service-jsonbig": "0.17.10"
37
37
  },
@@ -39,9 +39,9 @@
39
39
  "@types/semver": "^7.5.4",
40
40
  "@types/async": "^3.2.24",
41
41
  "@types/uuid": "^9.0.4",
42
- "@powersync/service-core-tests": "0.4.1",
43
- "@powersync/service-module-mongodb-storage": "0.5.1",
44
- "@powersync/service-module-postgres-storage": "0.3.1"
42
+ "@powersync/service-core-tests": "0.5.0",
43
+ "@powersync/service-module-mongodb-storage": "0.6.0",
44
+ "@powersync/service-module-postgres-storage": "0.4.0"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "tsc -b",
@@ -3,10 +3,10 @@ import { BinLogStream, BinLogStreamOptions } from '@module/replication/BinLogStr
3
3
  import { MySQLConnectionManager } from '@module/replication/MySQLConnectionManager.js';
4
4
  import { logger } from '@powersync/lib-services-framework';
5
5
  import {
6
- ActiveCheckpoint,
7
6
  BucketStorageFactory,
8
7
  OpId,
9
8
  OplogEntry,
9
+ ReplicationCheckpoint,
10
10
  storage,
11
11
  SyncRulesBucketStorage
12
12
  } from '@powersync/service-core';
@@ -148,7 +148,7 @@ export class BinlogStreamTestContext {
148
148
 
149
149
  export async function getClientCheckpoint(
150
150
  connection: mysqlPromise.Connection,
151
- bucketStorage: BucketStorageFactory,
151
+ storageFactory: BucketStorageFactory,
152
152
  options?: { timeout?: number }
153
153
  ): Promise<OpId> {
154
154
  const start = Date.now();
@@ -157,16 +157,16 @@ export async function getClientCheckpoint(
157
157
  // Since we don't use LSNs anymore, the only way to get that is to wait.
158
158
 
159
159
  const timeout = options?.timeout ?? 50_000;
160
- let lastCp: ActiveCheckpoint | null = null;
160
+ let lastCp: ReplicationCheckpoint | null = null;
161
161
 
162
162
  logger.info('Expected Checkpoint: ' + gtid.comparable);
163
163
  while (Date.now() - start < timeout) {
164
- const cp = await bucketStorage.getActiveCheckpoint();
165
- lastCp = cp;
166
- //logger.info('Last Checkpoint: ' + lastCp.lsn);
167
- if (!cp.hasSyncRules()) {
164
+ const storage = await storageFactory.getActiveStorage();
165
+ const cp = await storage?.getCheckpoint();
166
+ if (cp == null) {
168
167
  throw new Error('No sync rules available');
169
168
  }
169
+ lastCp = cp;
170
170
  if (cp.lsn && cp.lsn >= gtid.comparable) {
171
171
  return cp.checkpoint;
172
172
  }