feat: Added compact command#41
Open
michaelbarnes wants to merge 2 commits into
Open
Conversation
…he changeset. I also fixed the pre-existing issue with pnpm lint:fix
stevensJourney
approved these changes
May 20, 2026
Collaborator
stevensJourney
left a comment
There was a problem hiding this comment.
Happy with these changes :)
| instanceId: linked.instance_id, | ||
| linked, | ||
| operationId: compactResult.operation_id, | ||
| timeoutMs: 30 * 60 * 1000 |
Collaborator
There was a problem hiding this comment.
Compact operations can generally take quite some time. For that reason, I can see many more potential occurrences for this command to timeout - compared to the deploy command which is a less likely to timeout in a standard timeframe. I think it could be nice to potentially make this timeout configurable with an optional input flag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the
compactcommand to the CLI allowing developers to runcompactjobs on demand via the CLI.Usage
Implementation
The command is modeled directly on powersync destroy:
This is a Cloud-only command.
Tests
Added cli/test/commands/compact.test.ts covering:
All 127 tests in the CLI suite pass.
Incidental cleanup
Fixed two pre-existing lint errors in cli/test/commands/migrate.test.ts that were blocking the pre-commit hook:
mocha/no-global-tests.
AI Disclaimer
Claude Opus 4.7 assisted in the development of this feature.