Skip to content

refactor(sync): consolidate local SQLite under PowerSync - #62

Merged
birdmanmandbir merged 3 commits into
mainfrom
feat/powersync-sqlite-ownership
Aug 10, 2026
Merged

refactor(sync): consolidate local SQLite under PowerSync#62
birdmanmandbir merged 3 commits into
mainfrom
feat/powersync-sqlite-ownership

Conversation

@orga-agent

@orga-agent orga-agent Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What

Finish plan #1783 by making the daemon's PowerSyncDatabase the single local SQLite ownership boundary.

  • replace local SQLx SQLite access with LocalPowerSyncBackend over the daemon's shared PowerSync database
  • remove the SQLx dependency, pool, metadata, prepare scripts, CI flags, and dev tooling
  • upgrade to the finalized pn 0.0.7 candidate and rusqlite 0.39
  • remove Application write signals, the manual mpsc upload worker, startup drain, upload guard, and duplicate retry loop
  • rely on PowerSync's tested update notifications, initial CRUD scan, and retry actor
  • retain periodic/startup/shutdown WAL checkpoints as disk maintenance
  • update Nix with the libclang and CA inputs required by the new pn build/TLS stack

Net result: one daemon process, one PowerSync SQLite pool, one upload actor, and about 1,227 fewer lines in this branch's second commit.

Tests

  • cargo test --workspace --all-features — 321 tests passed
  • cargo check --workspace --all-targets --all-features — passed
  • strict workspace/all-target/all-feature Clippy — passed
  • cargo fmt --all --check — passed
  • cargo deny check — passed
  • cargo build --workspace — passed
  • bash scripts/test-release.sh — passed
  • nix build .#flicknote --no-link — passed
  • actor contracts passed for live writes, CRUD queued before connect, and transient upload retry
  • existing same-file schema/rollback/daemon/MCP contracts passed

Smoke

Using the real dev configuration:

  • branch daemon started and reported protocol 2
  • note 1817 was created and immediately read
  • ps_crud=0 after create
  • note 1817 was archived and ps_crud=0 again
  • the original installed daemon was restored

Dependency

Depends on GuionAI/powersync-native#3. This branch pins its finalized candidate commit 133f7eabacfbd49b3240f8313807105eab0ef315, including the reviewed SQLite cleanup and binding fixes. After pn PR #3 merges and v0.0.7-guion.1 is published, this PR will switch from the commit pin to that tag before merge.

Plan: FlickNote #1783.

@birdmanmandbir
birdmanmandbir merged commit 67adfde into main Aug 10, 2026
9 checks passed
@orga-agent
orga-agent Bot deleted the feat/powersync-sqlite-ownership branch August 10, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant