From c9f4925da7888a3477175869c8b57031d4fcec8f Mon Sep 17 00:00:00 2001 From: Daniel Vacic Date: Thu, 30 Jul 2026 02:24:18 +1000 Subject: [PATCH] fix(windows): compile non-Unix database paths --- .github/workflows/ci.yml | 12 ++++++++++++ powersync/src/db/connection.rs | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65549f2..7326612 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,3 +37,15 @@ jobs: - name: Build without rusqlite run: cargo build --no-default-features + + windows: + name: Check Windows build + runs-on: windows-latest + steps: + - uses: actions/checkout@v6 + + - name: Install stable Rust + run: rustup update stable + + - name: Check PowerSync crate + run: cargo check -p powersync --all-targets diff --git a/powersync/src/db/connection.rs b/powersync/src/db/connection.rs index e0f286e..25fe90e 100644 --- a/powersync/src/db/connection.rs +++ b/powersync/src/db/connection.rs @@ -204,7 +204,9 @@ fn path_to_cstring(p: &Path) -> Result { #[cfg(not(unix))] fn path_to_cstring(p: &Path) -> Result { - let s = p.to_str().ok_or_else(|| Error::InvalidPath(p.to_owned()))?; + let s = p.to_str().ok_or_else(|| RawPowerSyncError::ArgumentError { + desc: format!("Invalid path: {p:?}").into(), + })?; Ok( CString::new(s).map_err(|_| RawPowerSyncError::ArgumentError { desc: format!("Invalid path: {p:?}").into(),