Skip to content

Commit 00da768

Browse files
committed
Use higher-level createPowerSyncMongo() instead.
1 parent bfe0e64 commit 00da768

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/service-core/src/entry/commands/compact-action.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { Command } from 'commander';
22

33
import { logger } from '@powersync/lib-services-framework';
44
import * as v8 from 'v8';
5-
import { mongo } from '../../db/db-index.js';
6-
import { MongoBucketStorage, PowerSyncMongo } from '../../storage/storage-index.js';
5+
import { createPowerSyncMongo, MongoBucketStorage } from '../../storage/storage-index.js';
76
import { loadConfig } from '../../util/config.js';
87
import { extractRunnerOptions, wrapConfigCommand } from './config-command.js';
98

@@ -31,10 +30,10 @@ export function registerCompactAction(program: Command) {
3130

3231
const config = await loadConfig(runnerConfig);
3332
const { storage } = config;
34-
const client = mongo.createMongoClient(storage);
33+
const psdb = createPowerSyncMongo(storage);
34+
const client = psdb.client;
3535
await client.connect();
3636
try {
37-
const psdb = new PowerSyncMongo(client, { database: storage.database });
3837
const bucketStorage = new MongoBucketStorage(psdb, { slot_name_prefix: config.slot_name_prefix });
3938
const active = await bucketStorage.getActiveSyncRules();
4039
if (active == null) {

0 commit comments

Comments
 (0)