diff --git a/.env.example b/.env.example
index f9cf99a..b047609 100644
--- a/.env.example
+++ b/.env.example
@@ -1,5 +1,5 @@
# Copy to .env.test (ignored by git) and fill in.
-# Used only by the integration tests: cd src-tauri && cargo test -- --ignored --test-threads=1
+# Used only by the integration tests: set -a && . ./.env.test && set +a && go test ./internal/...
# Prefer a test user; the tests only create a TEMP table in PostgreSQL
# and only run SELECT / anonymous PL/SQL in Oracle. MySQL and SQL Server
# tests use temporary tables plus a few lq_* tables they drop at the end.
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..d632ede
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+# Shell scripts run in Git Bash and on Linux/macOS runners: keep LF.
+*.sh text eol=lf
diff --git a/.github/ISSUE_TEMPLATE/database_support.yml b/.github/ISSUE_TEMPLATE/database_support.yml
index 27349db..71af338 100644
--- a/.github/ISSUE_TEMPLATE/database_support.yml
+++ b/.github/ISSUE_TEMPLATE/database_support.yml
@@ -23,5 +23,5 @@ body:
- type: textarea
id: driver
attributes:
- label: Known Rust drivers or protocol notes
+ label: Known Go drivers or protocol notes
description: Optional. Links to drivers, protocol documentation or tools that handle this engine well.
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 5f97bd4..a9ea22c 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,20 +1,15 @@
version: 2
updates:
- - package-ecosystem: cargo
- directory: /src-tauri
+ - package-ecosystem: gomod
+ directory: /
schedule:
interval: weekly
day: monday
open-pull-requests-limit: 5
- # The Oracle driver is a pinned beta; upgrade it deliberately.
- ignore:
- - dependency-name: oracledb
groups:
- tauri:
- patterns: ["tauri", "tauri-*"]
- postgres:
- patterns: ["tokio-postgres", "tokio-postgres-*", "postgres-*"]
- rust-minor-and-patch:
+ wails:
+ patterns: ["github.com/wailsapp/*"]
+ go-minor-and-patch:
update-types: [minor, patch]
- package-ecosystem: npm
@@ -24,8 +19,6 @@ updates:
day: monday
open-pull-requests-limit: 5
groups:
- tauri:
- patterns: ["@tauri-apps/*"]
svelte:
patterns: ["svelte", "svelte-check", "@sveltejs/*"]
codemirror:
diff --git a/.github/scripts/render_pkgbuild.py b/.github/scripts/render_pkgbuild.py
index 039ba5b..fecea47 100644
--- a/.github/scripts/render_pkgbuild.py
+++ b/.github/scripts/render_pkgbuild.py
@@ -38,7 +38,7 @@ def render_release(version, assets, root=ROOT):
"__VERSION__": version,
"__SHA256_PORTABLE__": sha256(assets / f"LowQuery-{version}-linux-x64-portable.tar.gz"),
"__SHA256_DESKTOP__": sha256(root / "packaging/arch/lowquery.desktop"),
- "__SHA256_ICON__": sha256(root / "src-tauri/icons/128x128.png"),
+ "__SHA256_ICON__": sha256(root / "packaging/icons/128x128.png"),
},
)
diff --git a/.github/scripts/test_update_manifest.py b/.github/scripts/test_update_manifest.py
index f6d5a48..28cd573 100644
--- a/.github/scripts/test_update_manifest.py
+++ b/.github/scripts/test_update_manifest.py
@@ -11,7 +11,6 @@ def test_signed_assets_become_platforms_with_one_key_per_linux_format(self):
assets = Path(tmp)
for name in [
"LowQuery-1.2.3-windows-x64-setup.exe",
- "LowQuery-1.2.3-windows-x64.msi",
"LowQuery-1.2.3-macos-universal.app.tar.gz",
"LowQuery-1.2.3-linux-x64.AppImage",
"LowQuery-1.2.3-linux-x64.deb",
@@ -25,12 +24,13 @@ def test_signed_assets_become_platforms_with_one_key_per_linux_format(self):
self.assertEqual(
sorted(doc["platforms"]),
["darwin-aarch64", "darwin-x86_64", "linux-x86_64-appimage", "linux-x86_64-deb",
- "linux-x86_64-rpm", "windows-x86_64", "windows-x86_64-msi", "windows-x86_64-nsis"],
+ "linux-x86_64-rpm", "windows-x86_64", "windows-x86_64-nsis"],
)
self.assertNotIn("linux-x86_64", doc["platforms"])
self.assertTrue(doc["platforms"]["linux-x86_64-deb"]["url"].endswith("/LowQuery-1.2.3-linux-x64.deb"))
self.assertTrue(doc["platforms"]["linux-x86_64-rpm"]["url"].endswith("/LowQuery-1.2.3-linux-x64.rpm"))
- self.assertEqual(doc["platforms"]["windows-x86_64-msi"]["signature"], "sig-LowQuery-1.2.3-windows-x64.msi")
+ self.assertNotIn("windows-x86_64-msi", doc["platforms"])
+ self.assertEqual(doc["platforms"]["windows-x86_64-nsis"]["signature"], "sig-LowQuery-1.2.3-windows-x64-setup.exe")
self.assertTrue(doc["platforms"]["windows-x86_64"]["url"].endswith("/v1.2.3/LowQuery-1.2.3-windows-x64-setup.exe"))
def test_unsigned_assets_are_skipped(self):
diff --git a/.github/scripts/update_manifest.py b/.github/scripts/update_manifest.py
index f6a7166..5226a2b 100644
--- a/.github/scripts/update_manifest.py
+++ b/.github/scripts/update_manifest.py
@@ -17,9 +17,10 @@ def signed(keys, asset):
for key in keys:
platforms[key] = {"signature": signature.read_text().strip(), "url": f"{base}/{asset}"}
- # Installed Windows copies update with the installer they came from.
+ # Every Windows install updates with the NSIS setup. Copies installed from
+ # the MSI of 0.5.x find no "-msi" key and fall back to "windows-x86_64";
+ # the setup then replaces the MSI install with a per-user one.
signed(["windows-x86_64", "windows-x86_64-nsis"], f"LowQuery-{version}-windows-x64-setup.exe")
- signed(["windows-x86_64-msi"], f"LowQuery-{version}-windows-x64.msi")
signed(["darwin-aarch64", "darwin-x86_64"], f"LowQuery-{version}-macos-universal.app.tar.gz")
# One key per Linux format, never a generic one: a .deb install must get a
# .deb, an .rpm install an .rpm, and the Arch package nothing (pacman owns it).
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c24afef..cf0dc15 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -19,11 +19,6 @@ on:
permissions:
contents: read
-env:
- # Debug-build driver futures (SQL Server TLS above all) need more than the
- # 2 MiB default stack of test and tokio worker threads.
- RUST_MIN_STACK: "16777216"
-
concurrency:
group: verify-${{ github.workflow }}-${{ github.ref }}
# Cancel superseded pull request runs, but let every push to main finish.
@@ -78,11 +73,18 @@ jobs:
LQ_PG_USER: postgres
LQ_PG_PASSWORD: lowquery
LQ_PG_DB: postgres
+ # internal/menubar imports Wails, which on Linux links GTK and WebKitGTK
+ # through cgo; gtk3 picks the WebKitGTK 4.1 backend the packages use.
+ GOFLAGS: -tags=gtk3
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version-file: go.mod
+ - name: GTK and WebKitGTK headers
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Formatting
run: test -z "$(gofmt -l internal main.go)"
- run: go vet ./internal/...
@@ -115,91 +117,172 @@ jobs:
grep -q '"serverInfo"' mcp-out.txt
grep -q '"list_connections"' mcp-out.txt
- lint:
- name: Rust format and lint
- runs-on: ubuntu-22.04
+ # The release files, built with the release scripts, and upgrades from the
+ # last Tauri release the way its updater installs them. The packages get a
+ # version above every Tauri release, so the setup, dpkg and rpm do a real
+ # upgrade; the app inside still reports package.json's version.
+ windows-setup:
+ name: Windows setup (upgrade from Tauri)
+ runs-on: windows-2022
timeout-minutes: 30
+ env:
+ VERSION: "99.0.0"
+ TAURI_RELEASE: v0.5.7
steps:
+ # The packaging scripts are bash: keep their LF line endings.
+ - run: git config --global core.autocrlf false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- with:
- components: rustfmt, clippy
- - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
+ - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
+ - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
- workspaces: src-tauri
- key: lint
- - name: Install Linux desktop dependencies
+ go-version-file: go.mod
+ - run: bun install --frozen-lockfile
+ - run: bun run build
+ - name: Build the setup and the portable zip
+ shell: bash
+ run: bash packaging/windows/build.sh
+ - name: Download the Tauri setup
+ shell: bash
+ env:
+ GH_TOKEN: ${{ github.token }}
run: |
- sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libssl-dev libdbus-1-dev
- # The Tauri context macro needs the frontend output folder to exist.
- - run: mkdir -p dist
- - name: rustfmt
- run: cargo fmt --check --manifest-path src-tauri/Cargo.toml
- - name: clippy
- run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml --lib --tests -- -D warnings
+ gh release download "$TAURI_RELEASE" --repo "$GITHUB_REPOSITORY" --dir tauri \
+ --pattern "LowQuery-${TAURI_RELEASE#v}-windows-x64-setup.exe"
+ - name: Upgrade a Tauri install, uninstall, install fresh
+ shell: pwsh
+ run: |
+ ./packaging/test/windows-upgrade.ps1 `
+ -TauriSetup (Resolve-Path "tauri/LowQuery-$($env:TAURI_RELEASE.TrimStart('v'))-windows-x64-setup.exe") `
+ -Setup (Resolve-Path "build/release/LowQuery-$env:VERSION-windows-x64-setup.exe") `
+ -BuiltExe (Resolve-Path build/windows/lowquery.exe) `
+ -Version $env:VERSION
+ - name: Portable copy answers MCP
+ shell: bash
+ run: |
+ mkdir -p portable
+ powershell.exe -NoProfile -Command "Expand-Archive -Path 'build/release/LowQuery-${VERSION}-windows-x64-portable.zip' -DestinationPath portable"
+ ls portable
+ bash packaging/test/mcp-smoke.sh portable/LowQuery.exe
- rust:
- name: Rust (${{ matrix.os }})
- strategy:
- fail-fast: false
- matrix:
- os: [windows-2022, ubuntu-22.04, macos-latest]
- runs-on: ${{ matrix.os }}
- timeout-minutes: 45
+ linux-packages:
+ name: Linux packages (upgrade from Tauri)
+ runs-on: ubuntu-22.04
+ timeout-minutes: 40
+ env:
+ VERSION: "99.0.0"
+ TAURI_RELEASE: v0.5.7
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
- with:
- workspaces: src-tauri
- - name: Install Linux desktop dependencies
- if: runner.os == 'Linux'
+ - name: Install system libraries (GTK 3, WebKitGTK 4.1)
run: |
sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev libdbus-1-dev
- - name: Create frontend output folder
- shell: bash
- run: mkdir -p dist
- - name: Rust tests
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml
+ sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev librsvg2-dev
+ - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
+ - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
+ with:
+ go-version-file: go.mod
+ - run: bun install --frozen-lockfile
+ - run: bun run build
+ - name: Build the .deb, .rpm, AppImage and portable tarball
+ run: bash packaging/linux/build.sh
+ - name: Download the Tauri packages
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ v="${TAURI_RELEASE#v}"
+ gh release download "$TAURI_RELEASE" --repo "$GITHUB_REPOSITORY" --dir tauri \
+ --pattern "LowQuery-$v-linux-x64.deb" --pattern "LowQuery-$v-linux-x64.rpm"
+ - name: Package name and files match the Tauri package
+ run: |
+ set -euo pipefail
+ old="tauri/LowQuery-${TAURI_RELEASE#v}-linux-x64.deb"
+ new="build/release/LowQuery-${VERSION}-linux-x64.deb"
+ test "$(dpkg-deb -f "$old" Package)" = "$(dpkg-deb -f "$new" Package)"
+ # Regular files and links only: the Tauri .deb also lists every
+ # directory, without the trailing slash dpkg-deb usually prints.
+ files() { dpkg-deb -c "$1" | awk '$1 !~ /^d/ {print $6}' | sed -E 's|^\.?/?|/|' | sort; }
+ diff <(files "$old") <(files "$new")
+ dpkg-deb -I "$new"
+ - name: dpkg -i upgrades the Tauri .deb
+ run: |
+ set -euo pipefail
+ sudo apt-get install -y "./tauri/LowQuery-${TAURI_RELEASE#v}-linux-x64.deb"
+ test "$(dpkg-query -W -f='${Version}' low-query)" = "${TAURI_RELEASE#v}"
+ # What the Tauri updater runs (through pkexec).
+ sudo dpkg -i "build/release/LowQuery-${VERSION}-linux-x64.deb"
+ test "$(dpkg-query -W -f='${Version}' low-query)" = "$VERSION"
+ cmp /usr/bin/lowquery build/linux/lowquery
+ dpkg-query -S "$(readlink -f /usr/bin/lowquery)"
+ test -f /usr/share/applications/LowQuery.desktop
+ # No display: `lowquery mcp` must not need one.
+ env -u DISPLAY -u WAYLAND_DISPLAY bash packaging/test/mcp-smoke.sh /usr/bin/lowquery
+ - name: rpm -U upgrades the Tauri .rpm (Fedora)
+ run: |
+ docker run --rm -v "$PWD:/src:ro" -w /src -e VERSION -e TAURI_RELEASE fedora:44 bash -euo pipefail -c '
+ dnf install -y --setopt=install_weak_deps=False "./tauri/LowQuery-${TAURI_RELEASE#v}-linux-x64.rpm"
+ test "$(rpm -q --qf "%{VERSION}" low-query)" = "${TAURI_RELEASE#v}"
+ rpm -U "build/release/LowQuery-${VERSION}-linux-x64.rpm"
+ test "$(rpm -q --qf "%{VERSION}" low-query)" = "$VERSION"
+ test "$(sha256sum < /usr/bin/lowquery)" = "$(sha256sum < build/linux/lowquery)"
+ rpm -qf "$(readlink -f /usr/bin/lowquery)"
+ bash packaging/test/mcp-smoke.sh /usr/bin/lowquery
+ '
+ - name: AppImage answers MCP
+ run: |
+ file "build/release/LowQuery-${VERSION}-linux-x64.AppImage"
+ # No FUSE on the runner: the AppImage runtime extracts itself instead.
+ APPIMAGE_EXTRACT_AND_RUN=1 env -u DISPLAY -u WAYLAND_DISPLAY \
+ bash packaging/test/mcp-smoke.sh "build/release/LowQuery-${VERSION}-linux-x64.AppImage"
+ - name: Portable tarball answers MCP
+ run: |
+ mkdir portable
+ tar -xzf "build/release/LowQuery-${VERSION}-linux-x64-portable.tar.gz" -C portable
+ ls -l portable
+ env -u DISPLAY -u WAYLAND_DISPLAY bash packaging/test/mcp-smoke.sh portable/LowQuery
- postgres:
- name: PostgreSQL integration (${{ matrix.postgres }})
- runs-on: ubuntu-22.04
+ macos-app:
+ name: macOS universal app
+ runs-on: macos-15
+ # macOS runners can queue for long: build and check the bundle, no DMG.
timeout-minutes: 30
- strategy:
- fail-fast: false
- matrix:
- postgres: ["13", "17"]
- services:
- postgres:
- image: postgres:${{ matrix.postgres }}
- env:
- POSTGRES_PASSWORD: lowquery
- ports: ["5432:5432"]
- options: >-
- --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10
env:
- LQ_PG_HOST: localhost
- LQ_PG_PORT: "5432"
- LQ_PG_USER: postgres
- LQ_PG_PASSWORD: lowquery
- LQ_PG_DB: postgres
+ VERSION: "99.0.0"
+ MACOS_DMG: "0"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
+ - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
+ - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
- workspaces: src-tauri
- key: postgres
- - name: Install Linux desktop dependencies
+ go-version-file: go.mod
+ - run: bun install --frozen-lockfile
+ - run: bun run build
+ - name: Build LowQuery.app and the updater bundle
+ run: bash packaging/macos/build.sh
+ - name: Bundle matches the Tauri one
run: |
- sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libssl-dev libdbus-1-dev
- - run: mkdir -p dist
- - name: Integration tests against a real server
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml postgres -- --ignored --test-threads=1
+ set -euo pipefail
+ app=build/macos/LowQuery.app
+ plist="$app/Contents/Info.plist"
+ test "$(plutil -extract CFBundleIdentifier raw "$plist")" = dev.lowbloat.lowquery
+ test "$(plutil -extract CFBundleExecutable raw "$plist")" = lowquery
+ test "$(plutil -extract CFBundleIconFile raw "$plist")" = icon.icns
+ test "$(plutil -extract CFBundleShortVersionString raw "$plist")" = "$VERSION"
+ # macOS 12 is the oldest Go and Wails support; Finder refuses older
+ # systems with a clear message instead of a crash.
+ test "$(plutil -extract LSMinimumSystemVersion raw "$plist")" = 12.0
+ for arch in arm64 x86_64; do
+ vtool -arch "$arch" -show-build "$app/Contents/MacOS/lowquery" | grep -E 'minos 12\.0$'
+ done
+ test -f "$app/Contents/Resources/icon.icns"
+ lipo "$app/Contents/MacOS/lowquery" -verify_arch arm64 x86_64
+ codesign --verify --deep --strict "$app"
+ codesign -dv "$app" 2>&1 | grep 'Signature=adhoc'
+ # The Tauri updater drops the first path component of every entry.
+ tar -tzf "build/release/LowQuery-${VERSION}-macos-universal.app.tar.gz" > entries.txt
+ head -n 5 entries.txt
+ if grep -v '^LowQuery\.app/' entries.txt; then exit 1; fi
+ - name: lowquery mcp answers
+ run: bash packaging/test/mcp-smoke.sh build/macos/LowQuery.app/Contents/MacOS/lowquery
oracle:
name: Oracle integration (${{ matrix.name }})
@@ -240,18 +323,6 @@ jobs:
go-version-file: go.mod
- name: Go driver, transfer and MCP tests against a real server
run: go test -count=1 -v ./internal/drivers/oracle/... ./internal/transfer/... ./internal/mcp/...
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
- with:
- workspaces: src-tauri
- key: oracle-${{ matrix.service }}
- - name: Install Linux desktop dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libssl-dev libdbus-1-dev
- - run: mkdir -p dist
- - name: Integration tests against a real server
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml oracle -- --ignored --test-threads=1
mysql:
name: ${{ matrix.name }} integration
@@ -294,20 +365,6 @@ jobs:
go-version-file: go.mod
- name: Go driver, transfer and MCP tests against a real server
run: go test -count=1 -v ./internal/drivers/mysql/... ./internal/transfer/... ./internal/mcp/...
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
- with:
- workspaces: src-tauri
- key: mysql
- - name: Install Linux desktop dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libssl-dev libdbus-1-dev
- - run: mkdir -p dist
- - name: Integration tests against a real server
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml drivers::mysql -- --ignored --test-threads=1
- - name: MCP tests against a real server
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml mcp_mysql -- --ignored --test-threads=1
sqlserver:
name: SQL Server 2022 integration
@@ -336,20 +393,6 @@ jobs:
go-version-file: go.mod
- name: Go driver, transfer and MCP tests against a real server
run: go test -count=1 -v ./internal/drivers/sqlserver/... ./internal/transfer/... ./internal/mcp/...
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
- with:
- workspaces: src-tauri
- key: sqlserver
- - name: Install Linux desktop dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libssl-dev libdbus-1-dev
- - run: mkdir -p dist
- - name: Integration tests against a real server
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml drivers::sqlserver -- --ignored --test-threads=1
- - name: MCP tests against a real server
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml mcp_sqlserver -- --ignored --test-threads=1
redis:
name: ${{ matrix.name }} integration
@@ -377,20 +420,6 @@ jobs:
go-version-file: go.mod
- name: Go driver, transfer and MCP tests against a real server
run: go test -count=1 -v ./internal/drivers/redis/... ./internal/transfer/... ./internal/mcp/...
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
- with:
- workspaces: src-tauri
- key: redis
- - name: Install Linux desktop dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libssl-dev libdbus-1-dev
- - run: mkdir -p dist
- - name: Integration tests against a real server
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml drivers::redis_db -- --ignored --test-threads=1
- - name: MCP tests against a real server
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml mcp_redis -- --ignored --test-threads=1
cassandra:
name: Cassandra ${{ matrix.version }} integration
@@ -421,58 +450,24 @@ jobs:
go-version-file: go.mod
- name: Go driver, transfer and MCP tests against a real server
run: go test -count=1 -v ./internal/drivers/cassandra/... ./internal/transfer/... ./internal/mcp/...
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
- with:
- workspaces: src-tauri
- key: cassandra
- - name: Install Linux desktop dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libssl-dev libdbus-1-dev
- - run: mkdir -p dist
- - name: Integration tests against a real server
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml drivers::cassandra -- --ignored --test-threads=1
- - name: MCP tests against a real server
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml mcp_cassandra -- --ignored --test-threads=1
- - name: Export and import round trip
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml cassandra_export_import -- --ignored --test-threads=1
- # Builds the native Arch package the release publishes. Manual runs only:
- # it compiles the whole app, which pull requests do not need.
arch-package:
name: Arch Linux package
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-22.04
- timeout-minutes: 60
+ timeout-minutes: 40
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- - name: Install system libraries (WebKitGTK)
+ - name: Install system libraries (GTK 3, WebKitGTK 4.1)
run: |
sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libdbus-1-dev libappindicator3-dev \
- librsvg2-dev patchelf libjavascriptcoregtk-4.1-dev libsoup-3.0-dev
+ sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev librsvg2-dev
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
+ - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
- workspaces: src-tauri
- key: arch
+ go-version-file: go.mod
- run: bun install --frozen-lockfile
- - run: bun run tauri build --no-bundle
+ - run: bun run build
+ - run: bash packaging/linux/build.sh
- name: makepkg in an Arch container
- shell: bash
- run: |
- set -euo pipefail
- version=$(node -p "require('./package.json').version")
- arch_build="$PWD/arch-build"
- mkdir -p "$arch_build"
- cp src-tauri/target/release/lowquery "$arch_build/lowquery"
- cp src-tauri/icons/128x128.png "$arch_build/lowquery.png"
- cp packaging/arch/lowquery.desktop "$arch_build/lowquery.desktop"
- python3 .github/scripts/render_pkgbuild.py local "$version" "$arch_build"
- docker run --rm -v "$arch_build":/workspace -w /workspace archlinux:base-devel bash -c "
- useradd -m builder && chown -R builder:builder /workspace &&
- su builder -c 'makepkg -f --nodeps' &&
- pacman -Qip *.pkg.tar.zst && pacman -Qlp *.pkg.tar.zst
- "
+ run: bash packaging/arch/build.sh
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 16cbe7d..263d43f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -19,9 +19,12 @@ concurrency:
cancel-in-progress: false
env:
- CARGO_TERM_COLOR: always
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
+# Every platform builds the Go app with the scripts in packaging/, which CI
+# also runs (and tests upgrades of the Tauri builds with). The updater files
+# (setup, .app.tar.gz, AppImage, .deb, .rpm) get a .sig made with the Tauri
+# updater key, so Tauri installs (0.5.x) and Go installs both accept them.
jobs:
verify:
name: Check version
@@ -49,118 +52,74 @@ jobs:
runs-on: windows-2022
env:
VERSION: ${{ needs.verify.outputs.version }}
- TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
- TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
steps:
+ # The packaging scripts are bash: keep their LF line endings.
+ - run: git config --global core.autocrlf false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ env.RELEASE_TAG }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
+ with:
+ go-version-file: go.mod
- run: bun install --frozen-lockfile
- - name: Build with Tauri
- run: bun run tauri build
- - name: Collect installers and portable build
- shell: pwsh
- run: |
- New-Item -ItemType Directory -Force -Path "out" | Out-Null
-
- $nsis = Get-ChildItem "src-tauri/target/release/bundle/nsis/*.exe" | Select-Object -First 1
- if (-not $nsis) { throw "NSIS installer not found." }
- Copy-Item $nsis.FullName "out/LowQuery-$env:VERSION-windows-x64-setup.exe"
- Copy-Item "$($nsis.FullName).sig" "out/LowQuery-$env:VERSION-windows-x64-setup.exe.sig"
-
- $msi = Get-ChildItem "src-tauri/target/release/bundle/msi/*.msi" | Select-Object -First 1
- if ($msi) {
- Copy-Item $msi.FullName "out/LowQuery-$env:VERSION-windows-x64.msi"
- Copy-Item "$($msi.FullName).sig" "out/LowQuery-$env:VERSION-windows-x64.msi.sig"
- }
-
- $portable = "out/LowQuery-$env:VERSION-windows-x64-portable"
- New-Item -ItemType Directory -Force -Path $portable | Out-Null
- Copy-Item "src-tauri/target/release/lowquery.exe" "$portable/LowQuery.exe"
- Copy-Item README.md, LICENSE $portable
- Compress-Archive -Path "$portable/*" -DestinationPath "$portable.zip" -Force
- Remove-Item -Recurse -Force $portable
-
- Get-ChildItem out -File -Exclude *.sig | ForEach-Object {
- $hash = (Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLowerInvariant()
- "$hash $($_.Name)" | Set-Content "$($_.FullName).sha256" -Encoding ascii -NoNewline
- }
+ - run: bun run build
+ - name: Build the setup and the portable zip
+ shell: bash
+ run: bash packaging/windows/build.sh
+ - name: Sign the setup for the updater
+ shell: bash
+ env:
+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
+ run: go run ./tools/updatesign -app-version "$VERSION" "build/release/LowQuery-${VERSION}-windows-x64-setup.exe"
+ - name: Checksums
+ shell: bash
+ run: source packaging/common.sh && write_checksums build/release && ls -l build/release
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: lowquery-windows
- path: out/*
+ path: build/release/*
if-no-files-found: error
linux:
name: Linux x64
needs: [verify, checks]
+ # The oldest supported base, as for the Tauri builds: the AppImage needs
+ # its glibc or newer.
runs-on: ubuntu-22.04
env:
VERSION: ${{ needs.verify.outputs.version }}
- TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
- TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ env.RELEASE_TAG }}
- - name: Install system libraries (WebKitGTK)
+ - name: Install system libraries (GTK 3, WebKitGTK 4.1)
run: |
sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libdbus-1-dev libappindicator3-dev \
- librsvg2-dev patchelf libjavascriptcoregtk-4.1-dev libsoup-3.0-dev
+ sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev librsvg2-dev
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
+ with:
+ go-version-file: go.mod
- run: bun install --frozen-lockfile
- - name: Build with Tauri
- run: bun run tauri build
- - name: Collect packages and portable build
- shell: bash
+ - run: bun run build
+ - name: Build the .deb, .rpm, AppImage and portable tarball
+ run: bash packaging/linux/build.sh
+ - name: Build the Arch package (makepkg in an Arch container)
+ run: bash packaging/arch/build.sh
+ - name: Sign the packages for the updater
+ env:
+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: |
- set -euo pipefail
- mkdir -p out
- bundle=src-tauri/target/release/bundle
- # Each package keeps its updater signature: .deb and .rpm installs
- # update themselves through dpkg/rpm.
- deb="$(find $bundle/deb -name '*.deb' | head -n 1)"
- cp "$deb" "out/LowQuery-${VERSION}-linux-x64.deb"
- cp "$deb.sig" "out/LowQuery-${VERSION}-linux-x64.deb.sig"
- rpm="$(find $bundle/rpm -name '*.rpm' | head -n 1)"
- cp "$rpm" "out/LowQuery-${VERSION}-linux-x64.rpm"
- cp "$rpm.sig" "out/LowQuery-${VERSION}-linux-x64.rpm.sig"
- appimage="$(find $bundle/appimage -name '*.AppImage' | head -n 1)"
- cp "$appimage" "out/LowQuery-${VERSION}-linux-x64.AppImage"
- cp "$appimage.sig" "out/LowQuery-${VERSION}-linux-x64.AppImage.sig"
-
- portable="out/LowQuery-${VERSION}-linux-x64-portable"
- mkdir -p "$portable"
- cp src-tauri/target/release/lowquery "$portable/LowQuery"
- chmod +x "$portable/LowQuery"
- cp README.md LICENSE "$portable/"
- tar -czf "$portable.tar.gz" -C "$portable" .
- rm -rf "$portable"
-
- # Native Arch Linux package (pacman -U), built with makepkg in an
- # Arch container from the binary compiled above.
- arch_build="$PWD/arch-build"
- mkdir -p "$arch_build"
- cp src-tauri/target/release/lowquery "$arch_build/lowquery"
- cp src-tauri/icons/128x128.png "$arch_build/lowquery.png"
- cp packaging/arch/lowquery.desktop "$arch_build/lowquery.desktop"
- python3 .github/scripts/render_pkgbuild.py local "$VERSION" "$arch_build"
- docker run --rm -v "$arch_build":/workspace -w /workspace archlinux:base-devel bash -c "
- useradd -m builder && chown -R builder:builder /workspace &&
- su builder -c 'makepkg -f --nodeps'
- "
- cp "$(find "$arch_build" -name '*.pkg.tar.zst' | head -n 1)" "out/LowQuery-${VERSION}-linux-x86_64.pkg.tar.zst"
- sudo rm -rf "$arch_build"
-
- (cd out && for f in *; do [[ "$f" == *.sig ]] || sha256sum "$f" > "$f.sha256"; done)
+ go run ./tools/updatesign -app-version "$VERSION" "build/release/LowQuery-${VERSION}-linux-x64.deb" "build/release/LowQuery-${VERSION}-linux-x64.rpm" "build/release/LowQuery-${VERSION}-linux-x64.AppImage"
+ - name: Checksums
+ run: source packaging/common.sh && write_checksums build/release && ls -l build/release
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: lowquery-linux
- path: out/*
+ path: build/release/*
if-no-files-found: error
macos:
@@ -169,34 +128,29 @@ jobs:
runs-on: macos-15
env:
VERSION: ${{ needs.verify.outputs.version }}
- TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
- TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ env.RELEASE_TAG }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
- targets: aarch64-apple-darwin,x86_64-apple-darwin
+ go-version-file: go.mod
- run: bun install --frozen-lockfile
- - name: Build with Tauri (universal)
- run: bun run tauri build --target universal-apple-darwin
- - name: Collect DMG and updater bundle
- shell: bash
- run: |
- set -euo pipefail
- mkdir -p out
- dmg=$(find src-tauri/target/universal-apple-darwin/release/bundle/dmg -name '*.dmg' | head -n 1)
- cp "$dmg" "out/LowQuery-${VERSION}-macos-universal.dmg"
- tarball=$(find src-tauri/target/universal-apple-darwin/release/bundle/macos -name '*.app.tar.gz' | head -n 1)
- cp "$tarball" "out/LowQuery-${VERSION}-macos-universal.app.tar.gz"
- cp "$tarball.sig" "out/LowQuery-${VERSION}-macos-universal.app.tar.gz.sig"
- (cd out && for f in *; do [[ "$f" == *.sig ]] || shasum -a 256 "$f" > "$f.sha256"; done)
+ - run: bun run build
+ - name: Build LowQuery.app, the DMG and the updater bundle
+ run: bash packaging/macos/build.sh
+ - name: Sign the updater bundle
+ env:
+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
+ run: go run ./tools/updatesign -app-version "$VERSION" "build/release/LowQuery-${VERSION}-macos-universal.app.tar.gz"
+ - name: Checksums
+ run: source packaging/common.sh && write_checksums build/release && ls -l build/release
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: lowquery-macos
- path: out/*
+ path: build/release/*
if-no-files-found: error
publish:
diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml
index 18e61cd..7c06ef0 100644
--- a/.github/workflows/security.yml
+++ b/.github/workflows/security.yml
@@ -6,11 +6,10 @@ on:
workflow_dispatch:
pull_request:
paths:
- - "src-tauri/Cargo.toml"
- - "src-tauri/Cargo.lock"
+ - "go.mod"
+ - "go.sum"
- "package.json"
- "bun.lock"
- - "src-tauri/deny.toml"
- ".github/workflows/security.yml"
permissions:
@@ -21,17 +20,23 @@ concurrency:
cancel-in-progress: true
jobs:
- rust:
- name: Rust advisories and bans
+ go:
+ name: Go vulnerabilities
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- - uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2
+ - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
- tool: cargo-deny
- - name: cargo deny
- run: cargo deny --manifest-path src-tauri/Cargo.toml check advisories bans sources
+ go-version-file: go.mod
+ # internal/menubar imports Wails, which on Linux needs these through cgo.
+ - name: GTK and WebKitGTK headers
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
+ # Reports only vulnerabilities in code the app actually calls.
+ - name: govulncheck
+ run: go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 -tags gtk3 ./internal/... ./tools/...
javascript:
name: npm advisories
diff --git a/.gitignore b/.gitignore
index 07ba6d2..840d29e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,11 +32,7 @@ vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vite/
-# --- Tauri / Rust ---
-src-tauri/target/
-src-tauri/gen/
-target/
-**/*.rs.bk
+# --- Build output ---
*.pdb
# --- Tests ---
@@ -52,6 +48,8 @@ blob-report/
!.env.example
*.pem
*.key
+# Throwaway minisign key that signs the updater test fixtures; not a release key.
+!internal/updater/testdata/throwaway.key
*.p12
*.pfx
*.jks
@@ -80,3 +78,6 @@ logs/
# --- Release artifacts ---
/release-assets
+
+# Windows resources generated by packaging/windows/build.sh
+*.syso
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ad6965b..af62d0b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,21 @@ All notable changes to LowQuery are documented here. The format follows [Keep a
## [Unreleased]
+### Changed
+- **LowQuery now runs on Go and Wails instead of Rust and Tauri.** It has the same window, connections, drivers, export and import, AI agents (MCP) and connection importers. Every driver passes the same tests against real servers in CI: PostgreSQL 13 and 17, Oracle 21c and 23ai, MySQL 8.4, MariaDB 11.4, SQL Server 2022, Redis 7.4, Valkey 8, and Cassandra 4.1 and 5.0.
+ - **Installed copies update as usual.**
+ - The Windows setup installs over the previous version in the same folder and keeps its shortcuts.
+ - `.deb`, `.rpm`, AppImage and the macOS app replace the previous version in place.
+ - **Kept from the previous version:**
+ - saved connections and passwords;
+ - open query tabs and their SQL, export preferences and the sidebar width.
+ - **Oracle:** Cancel now interrupts a running statement.
+ - **SQL Server:** `PRINT` and `RAISERROR` messages show in the messages panel.
+
+### Removed
+- **The Windows MSI.** MSI installs update to the setup: it removes the MSI copy, which needs administrator rights once, and installs per user.
+- **macOS 10.13 to 11.** The app now needs macOS 12 or later, the oldest version Go and Wails support. The update is still offered on older Macs, and once installed the app no longer opens there. On macOS 10.13 to 11, skip **Restart to update** and keep using 0.5.7; if the update is already installed, download [0.5.7](https://github.com/LowBloat/LowQuery/releases/tag/v0.5.7) again.
+
## [0.5.7] - 2026-11-27
### Changed
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index fafcc3c..9a6aaac 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,6 +1,6 @@
# Contributing to LowQuery
-LowQuery is an open-source SQL client built with Svelte, TypeScript, Tauri and Rust. Contributions can include bug fixes, database support, documentation, accessibility improvements and tests.
+LowQuery is an open-source SQL client built with Svelte, TypeScript, Go and Wails. Contributions can include bug fixes, database support, documentation, accessibility improvements and tests.
Keep repository documentation, issues and pull requests in English so contributors around the world can participate.
@@ -19,7 +19,7 @@ Never include passwords, connection strings with credentials or real business da
## Set up development
-Install [Bun](https://bun.sh/), the stable [Rust toolchain](https://rustup.rs/) and the [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/) for your operating system. No Oracle Client or Instant Client is needed.
+Install [Bun](https://bun.sh/) and [Go](https://go.dev/dl/) (the version in `go.mod`). On Linux, also install the GTK 3 and WebKitGTK 4.1 development packages (`libgtk-3-dev libwebkit2gtk-4.1-dev` on Debian and Ubuntu). No Oracle Client or Instant Client is needed.
Fork the repository, then clone your fork and create a branch:
@@ -28,7 +28,7 @@ git clone https://github.com/YOUR-USERNAME/LowQuery.git
cd LowQuery
git switch -c fix/short-description
bun install --frozen-lockfile
-bun run tauri dev
+bun run app
```
To work on the interface without a database, run `bun run dev` and open http://localhost:1420. A development-only mock backend answers every command; add `?demo` to the URL to start with a sample query and result.
@@ -41,20 +41,19 @@ Run the checks relevant to your change:
bun run check
bun test
bun run build
-cargo fmt --check --manifest-path src-tauri/Cargo.toml
-cargo clippy --manifest-path src-tauri/Cargo.toml --lib --tests -- -D warnings
-cargo test --locked --lib --manifest-path src-tauri/Cargo.toml
+gofmt -l internal main.go tools
+go vet ./...
+go test ./...
```
Driver changes need integration tests against a real server. Copy `.env.example` to `.env.test` (it is ignored by git), fill in a test database and run:
```bash
-cd src-tauri
-set -a; source ../.env.test; set +a
-cargo test --lib -- --ignored --test-threads=1
+set -a; source .env.test; set +a
+go test -count=1 ./internal/...
```
-SQLite tests need no server and always run. CI runs the server tests against PostgreSQL 13 and 17, Oracle Database Free, MySQL 8.4, MariaDB 11.4, SQL Server 2022, Redis 7.4, Valkey 8 and Apache Cassandra 4.1 and 5.0 in containers, so a pull request shows whether a change works on every engine. For a bug fix, add a regression test that fails without the fix.
+Each engine's tests run only when its `LQ_*` variables are set; SQLite tests need no server and always run. CI runs the server tests against PostgreSQL 13 and 17, Oracle Database Free, MySQL 8.4, MariaDB 11.4, SQL Server 2022, Redis 7.4, Valkey 8 and Apache Cassandra 4.1 and 5.0 in containers, so a pull request shows whether a change works on every engine. For a bug fix, add a regression test that fails without the fix.
## Open a pull request
diff --git a/README.md b/README.md
index 1f5dc03..71e8988 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-
+
LowQuery
@@ -25,17 +25,17 @@
---
-LowQuery is an **open-source desktop SQL client** for Windows, Linux and macOS. It connects to **PostgreSQL, Oracle, MySQL, MariaDB, SQL Server, SQLite, Redis and Apache Cassandra**, and treats each one as itself: every engine goes through its own native driver and protocol, with server-side row limits, exact values and the script rules of that engine. Oracle needs **no Oracle Client or Instant Client**. The app is built with Tauri and Rust, so it starts fast and stays small.
+LowQuery is an **open-source desktop SQL client** for Windows, Linux and macOS. It connects to **PostgreSQL, Oracle, MySQL, MariaDB, SQL Server, SQLite, Redis and Apache Cassandra**, and treats each one as itself: every engine goes through its own native driver and protocol, with server-side row limits, exact values and the script rules of that engine. Oracle needs **no Oracle Client or Instant Client**. The app is built with Go and Wails on the system webview, so it starts fast and stays small.
| Database | How LowQuery connects |
| --- | --- |
-| PostgreSQL | Extended protocol with [`tokio-postgres`](https://crates.io/crates/tokio-postgres) |
-| Oracle | [`oracledb`](https://github.com/oracle/rust-oracledb), Oracle's official thin driver in pure Rust |
-| MySQL and MariaDB | Native protocol with [`mysql_async`](https://crates.io/crates/mysql_async) |
-| SQL Server and Azure SQL | TDS protocol with [`tiberius`](https://crates.io/crates/tiberius), SQL logins or Windows accounts |
-| SQLite | Embedded engine ([`rusqlite`](https://crates.io/crates/rusqlite)), opens local database files |
-| Redis and Valkey | RESP3 with [`redis-rs`](https://crates.io/crates/redis): redis-cli commands, results as tables, keys browsed by type |
-| Apache Cassandra | CQL native protocol with [`scylla`](https://crates.io/crates/scylla) (Cassandra 3.x to 5.x): keyspaces, tables, views, types and functions from `system_schema`, exact CQL values |
+| PostgreSQL | Extended protocol with [`pgx`](https://github.com/jackc/pgx)'s `pgconn` |
+| Oracle | [`go-ora`](https://github.com/sijms/go-ora), a thin driver in pure Go |
+| MySQL and MariaDB | Native protocol; the handshake from [`go-sql-driver/mysql`](https://github.com/go-sql-driver/mysql) |
+| SQL Server and Azure SQL | TDS protocol with [`go-mssqldb`](https://github.com/microsoft/go-mssqldb), SQL logins or Windows accounts |
+| SQLite | Embedded engine ([`ncruces/go-sqlite3`](https://github.com/ncruces/go-sqlite3), no C compiler needed), opens local database files |
+| Redis and Valkey | RESP3 with [`go-redis`](https://github.com/redis/go-redis): redis-cli commands, results as tables, keys browsed by type |
+| Apache Cassandra | CQL native protocol with [`gocql`](https://github.com/apache/cassandra-gocql-driver) (Cassandra 3.x to 5.x): keyspaces, tables, views, types and functions from `system_schema`, exact CQL values |

@@ -72,9 +72,9 @@ The [latest release](https://github.com/LowBloat/LowQuery/releases/latest) inclu
| Platform | Available formats |
| --- | --- |
-| Windows x64 | Setup `.exe`, `.msi`, portable `.zip` |
+| Windows x64 | Setup `.exe`, portable `.zip` |
| Linux x64 | `.AppImage`, `.deb`, `.rpm`, Arch `.pkg.tar.zst`, portable `.tar.gz` |
-| macOS (Apple Silicon and Intel) | Universal `.dmg` |
+| macOS 12 or later (Apple Silicon and Intel) | Universal `.dmg` |
**Arch Linux, Omarchy and other Arch-based systems.** Install the native package with `sudo pacman -U LowQuery--linux-x86_64.pkg.tar.zst`. Each release also publishes a `PKGBUILD` with real checksums that builds the same package from the portable archive with `makepkg -si`.
@@ -117,9 +117,9 @@ gh attestation verify LowQuery--linux-x64.AppImage --repo LowBloat/LowQ
| Database | Row limit | Values | Server messages | Cancel | Scripts |
| --- | --- | --- | --- | --- | --- |
| PostgreSQL | Portal executed with `max_rows` | Binary format decoded per type into server-style text: exact NUMERIC, infinite dates, intervals, arrays, ranges | `NOTICE`, `WARNING` | Server cancel protocol | `;`, `$$` bodies, nested comments, `E''` strings |
-| Oracle | `prefetch_rows` and fetch size sized from the limit | NUMBER, DATE, TIMESTAMP with time zone, RAW/BLOB, CLOB, JSON, VECTOR, intervals | `DBMS_OUTPUT` | Not in the driver yet; scripts stop before the next statement | `;` for SQL, `/` for PL/SQL, `q'[...]'` strings |
+| Oracle | Prefetch and fetch size sized from the limit | NUMBER, DATE, TIMESTAMP with time zone, RAW/BLOB, CLOB, JSON, VECTOR, intervals | `DBMS_OUTPUT` | Interrupts the running statement | `;` for SQL, `/` for PL/SQL, `q'[...]'` strings |
| MySQL, MariaDB | `sql_select_limit` on the server | Text protocol: exact DECIMAL, unsigned BIGINT, zero dates, binary as hex | `SHOW WARNINGS` | `KILL QUERY` from a second connection | `DELIMITER`, `#` comments, backticks, backslash escapes |
-| SQL Server, Azure SQL | `SET ROWCOUNT` for plain SELECT batches | Exact decimal, datetime2 and datetimeoffset precision, uniqueidentifier, binary as hex | Not exposed by the driver yet | TDS attention | `GO` batches, `BEGIN...END` blocks, `[brackets]` |
+| SQL Server, Azure SQL | `SET ROWCOUNT` for plain SELECT batches | Exact decimal, datetime2 and datetimeoffset precision, uniqueidentifier, binary as hex | `PRINT`, `RAISERROR` below severity 11 | TDS attention | `GO` batches, `BEGIN...END` blocks, `[brackets]` |
| SQLite | Stops stepping at the limit | Storage class and declared type; blobs as hex | — | `sqlite3_interrupt` | Trigger bodies, `[brackets]`, backticks |
| Redis, Valkey | Long replies cut at the limit; the tree uses `SCAN` | RESP3 types: maps as field/value, `WITHSCORES` as member/score, `INFO` as rows | — | `CLIENT UNBLOCK` for blocking commands | One redis-cli command per line, `#` comments |
| Apache Cassandra | Paging: the page size comes from the limit and reading stops there | Exact `varint` and `decimal`, `timestamp`, `date`, `time`, `duration`, `uuid`, blobs as hex; collections, tuples, UDTs and vectors as CQL literals | Server warnings (tombstones, aggregations without a partition key) | Stops waiting; CQL cannot cancel on the server | `;`, `BEGIN BATCH ... APPLY BATCH` as one statement, `$$` bodies, `--`, `//` and `/* */` comments |
@@ -132,20 +132,19 @@ Read [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the code layout and how a
## Build from source
-Install [Bun](https://bun.sh), the stable [Rust toolchain](https://rustup.rs/) and the [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/).
+Install [Bun](https://bun.sh) and [Go](https://go.dev/dl/) (the version in `go.mod`). On Linux, also install the GTK 3 and WebKitGTK 4.1 development packages (`libgtk-3-dev libwebkit2gtk-4.1-dev` on Debian and Ubuntu). Windows uses the WebView2 runtime that ships with Windows 10 and 11.
```bash
git clone https://github.com/LowBloat/LowQuery.git
cd LowQuery
bun install
-bun run tauri dev
+bun run app
```
-`bun run tauri build --no-bundle` builds the app for your system. Installers are also signed for the updater, so a full `bun run tauri build` needs the signing key; without it, disable that step with `bun run tauri build -c '{"bundle":{"createUpdaterArtifacts":false}}'`. To work only on the interface, `bun run dev` serves it at http://localhost:1420 with a development mock backend.
+`bun run app` starts the interface with hot reload inside the desktop window. `bun run build:app` builds `bin/LowQuery.exe` on Windows; `bun run package:windows`, `package:linux` and `package:macos` build the installers and packages of a release (see `packaging/`). Release files are signed for the updater in CI only. To work only on the interface, `bun run dev` serves it at http://localhost:1420 with a development mock backend.
## Roadmap
-- Interrupt a running Oracle call when the driver exposes it.
- Bind variables (`:name`, `$1`) with a value dialog.
- Fetch more rows on demand without running the query again.
- Execution plans (`EXPLAIN`, `DBMS_XPLAN`).
diff --git a/bun.lock b/bun.lock
index e8939bf..8692923 100644
--- a/bun.lock
+++ b/bun.lock
@@ -17,17 +17,11 @@
"@lezer/highlight": "^1.2.5",
"@lucide/svelte": "^1.59.0",
"@tanstack/svelte-table": "^9.3.1",
- "@tauri-apps/api": "^2.12.4",
- "@tauri-apps/plugin-dialog": "^2.8.3",
- "@tauri-apps/plugin-opener": "^2.7.2",
- "@tauri-apps/plugin-process": "^2.4.0",
- "@tauri-apps/plugin-updater": "^2.14.0",
"@wailsio/runtime": "3.1.0",
"codemirror": "^6.0.2",
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^7.3.1",
- "@tauri-apps/cli": "^2.12.3",
"@tsconfig/svelte": "^5.0.8",
"@types/bun": "^1.4.3",
"svelte": "^5.57.2",
@@ -138,40 +132,6 @@
"@tanstack/table-core": ["@tanstack/table-core@9.3.1", "", { "dependencies": { "@tanstack/store": "^0.11.2" } }, "sha512-zQvlxSNi2qGM3L4jh85Z6hqMfdIR5qOfD9KHOU32nuKFJGN0RlJ7UvV1lsPb1fPVhpFYI0VP3jJGxLdLDpTKjQ=="],
- "@tauri-apps/api": ["@tauri-apps/api@2.12.4", "", {}, "sha512-pVmfis+4zT8H0Qhp3xPZx9Ju7kpzvA6rr/PSJPyuwfvucTQ8sVt61NYU9KMkK703UFlYadFmjKA4HhybOtN0gg=="],
-
- "@tauri-apps/cli": ["@tauri-apps/cli@2.12.3", "", { "optionalDependencies": { "@tauri-apps/cli-darwin-arm64": "2.12.3", "@tauri-apps/cli-darwin-x64": "2.12.3", "@tauri-apps/cli-linux-arm-gnueabihf": "2.12.3", "@tauri-apps/cli-linux-arm64-gnu": "2.12.3", "@tauri-apps/cli-linux-arm64-musl": "2.12.3", "@tauri-apps/cli-linux-riscv64-gnu": "2.12.3", "@tauri-apps/cli-linux-x64-gnu": "2.12.3", "@tauri-apps/cli-linux-x64-musl": "2.12.3", "@tauri-apps/cli-win32-arm64-msvc": "2.12.3", "@tauri-apps/cli-win32-ia32-msvc": "2.12.3", "@tauri-apps/cli-win32-x64-msvc": "2.12.3" }, "bin": { "tauri": "tauri.js" } }, "sha512-f7/LsY74SVb1ChmOPw1ajOpxii0GSzDAgmWHRci8JUYuuai04rXsSbFobpmB0sP2DdlvMD/B5ZotEn8GOGMRUg=="],
-
- "@tauri-apps/cli-darwin-arm64": ["@tauri-apps/cli-darwin-arm64@2.12.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-xmVNoJOOKzKLj7GLHXmXLimRby9M42aBIJa0sB80N7o24eKV5JiVmToKTRLVH9yhL05GZ/B6rSSOmbzNFJwBAA=="],
-
- "@tauri-apps/cli-darwin-x64": ["@tauri-apps/cli-darwin-x64@2.12.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-URd+0usfmUQQyb5kNPiKt2OT8gp7oGU7QR+qOppB6e35mpVBFFVNhWc9oWb3p0u71fDJ09DpF4T6m9xYxoIB8g=="],
-
- "@tauri-apps/cli-linux-arm-gnueabihf": ["@tauri-apps/cli-linux-arm-gnueabihf@2.12.3", "", { "os": "linux", "cpu": "arm" }, "sha512-0kwUVx2LbmOoTRlwF1oDww7th4/NSluv4ZBQ6KRZsFKg4g0TlTcIiJ0VehqkQYUeC9xIT1Mk6XtF52mI155VSQ=="],
-
- "@tauri-apps/cli-linux-arm64-gnu": ["@tauri-apps/cli-linux-arm64-gnu@2.12.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-gKSGDx6fx+HBLQmG6guChFdisbrCSdx9Yli+j5teOa64gm1CeM+C6NLru5Pj3ZkkEep05BmCFjxvX+cjqAycZQ=="],
-
- "@tauri-apps/cli-linux-arm64-musl": ["@tauri-apps/cli-linux-arm64-musl@2.12.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-Yr59qMy/gcvAfBuFdCGlAmGiLsYWMFDbsP4bAI6iNBzcJTGrYWZGeiQhGDo29MQwfF/NUBqyM2qljXu5tZ6wjQ=="],
-
- "@tauri-apps/cli-linux-riscv64-gnu": ["@tauri-apps/cli-linux-riscv64-gnu@2.12.3", "", { "os": "linux", "cpu": "none" }, "sha512-jKr0/REBMnLKC0OwPQZkyge0mKDaNZ0b/AbfGwVyCgFfwS730EVLfVDo3nt7MUu6jJaytRq08+xSj5qfy+U1+Q=="],
-
- "@tauri-apps/cli-linux-x64-gnu": ["@tauri-apps/cli-linux-x64-gnu@2.12.3", "", { "os": "linux", "cpu": "x64" }, "sha512-gTkEqJAGCMROGanxHnzaJzQ+/rXl39HWVg0/hDODS1wDWBGqoceqGC6Qm1+mQbyT11xnsB8mKu/gyVID/YpFIw=="],
-
- "@tauri-apps/cli-linux-x64-musl": ["@tauri-apps/cli-linux-x64-musl@2.12.3", "", { "os": "linux", "cpu": "x64" }, "sha512-T2dTxL1svRym71fZtaW4pZYXbthbfFsEJr1NeOUg/p7laWXZbUt/8DMSZf8recu9f7+1F/Lv00HtzsEu6vDO9w=="],
-
- "@tauri-apps/cli-win32-arm64-msvc": ["@tauri-apps/cli-win32-arm64-msvc@2.12.3", "", { "os": "win32", "cpu": "arm64" }, "sha512-eoiQwpEZWbpsVHcM9BAzqqe4TCHszvr3rsM7pUQ4ofLK0lF1i1d/jX0Qo5DYMqcrUtwQuDdDuOCbcT0Izf1VwQ=="],
-
- "@tauri-apps/cli-win32-ia32-msvc": ["@tauri-apps/cli-win32-ia32-msvc@2.12.3", "", { "os": "win32", "cpu": "ia32" }, "sha512-kE+KUg6Dbbkgvcw0m99wJVIToFQzJqpMBAXah74WqxaLzssNwSTUccrHp6+QVzMhjQP330tvekFmnQF+0NbE6Q=="],
-
- "@tauri-apps/cli-win32-x64-msvc": ["@tauri-apps/cli-win32-x64-msvc@2.12.3", "", { "os": "win32", "cpu": "x64" }, "sha512-L7wndWAgX2mLW7alswpL3d1R0P9FN2WYBgHaQkAYEBxHHGkY4vFX9CjcRQ1LAxDAMIJxrY7/aDziFJeChS84NQ=="],
-
- "@tauri-apps/plugin-dialog": ["@tauri-apps/plugin-dialog@2.8.3", "", { "dependencies": { "@tauri-apps/api": "^2.12.0" } }, "sha512-Hd/yBfk2R5v2MFrz/0VArSXeh8xKLLXGunqSiTtcHKn1zNZwaKujuA0VSwUvNfwC4hDoF1PveS+gBDNe3nHspw=="],
-
- "@tauri-apps/plugin-opener": ["@tauri-apps/plugin-opener@2.7.2", "", { "dependencies": { "@tauri-apps/api": "^2.12.0" } }, "sha512-LyybP1VSzTMQiaFYcsbAse47KpivlyXdLZMQzGLEnkgQacGESnpjAfFoQ6h5sqWgAdZDH9szYjPzHMpv0Sz+TQ=="],
-
- "@tauri-apps/plugin-process": ["@tauri-apps/plugin-process@2.4.0", "", { "dependencies": { "@tauri-apps/api": "^2.12.0" } }, "sha512-GddrmsSLAYrLa/yTXlXK/YRDzUgYeeOnUXTbiyvJWkmI424RmDPD3FVLeqcon7rv6O6ZfhBilcrHWnSo7o6hIQ=="],
-
- "@tauri-apps/plugin-updater": ["@tauri-apps/plugin-updater@2.14.0", "", { "dependencies": { "@tauri-apps/api": "^2.12.0" } }, "sha512-gdylJ9tger4hkyOn24QZd6MNOKVo2Eh53iw5th2Qj1vKTR/+u4PIwJWuiis5hohYvobn6iOvlnALfrqIPSzh7Q=="],
-
"@tsconfig/svelte": ["@tsconfig/svelte@5.0.8", "", {}, "sha512-UkNnw1/oFEfecR8ypyHIQuWYdkPvHiwcQ78sh+ymIiYoF+uc5H1UBetbjyqT+vgGJ3qQN6nhucJviX6HesWtKQ=="],
"@types/bun": ["@types/bun@1.4.3", "", { "dependencies": { "bun-types": "1.4.3" } }, "sha512-N67Pqy8JXbAY/j0tNraS3V5mubGvc6rrrNDmDCtZLlFzccbUJPDb0tvgUBC5q4m8ybkP93Jcn1QB+RYQ6PvBhw=="],
diff --git a/docs/AI.md b/docs/AI.md
index ab892cb..a3b6b99 100644
--- a/docs/AI.md
+++ b/docs/AI.md
@@ -46,15 +46,15 @@ Read-only access does not rely on the agent's good behaviour. Every call goes th
| --- | --- | --- |
| PostgreSQL | `SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY` | read-only transaction, rolled back |
| MySQL, MariaDB | `SET SESSION TRANSACTION READ ONLY` | `START TRANSACTION READ ONLY`, rolled back |
- | Oracle | manual commit | `SET TRANSACTION READ ONLY`, rolled back |
+ | Oracle | manual commit | `SET TRANSACTION READ ONLY` (not for `explain`, which writes `PLAN_TABLE`), rolled back |
| SQL Server | implicit transactions | always rolled back |
- | SQLite | file opened read-only (`mode=ro`) and `PRAGMA query_only` | rolled back |
+ | SQLite | file opened read-only (`mode=ro`) when it can be, and `PRAGMA query_only` | rolled back |
| Redis | | allowlist of read commands; `KEYS` refused in favour of `SCAN` |
| Cassandra | | CQL has no read-only transaction: only `SELECT` and `LIST` pass the classifier, and `USE` is refused so no call changes the session keyspace (names are written `keyspace.table`) |
On **Read and write** connections, `execute` runs with autocommit. Transaction control (`BEGIN`, `COMMIT`, `SET autocommit`...) is refused (on Cassandra: `BEGIN TRANSACTION`, `COMMIT`, `ROLLBACK`; `BEGIN BATCH` is allowed), and a statement that leaves a transaction open is rolled back.
-Every call has a time limit (30 seconds, or `LOWQUERY_MCP_TIMEOUT` in seconds), after which the statement is cancelled on the server.
+Every call has a time limit (30 seconds, or `LOWQUERY_MCP_TIMEOUT` in seconds). When it runs out, or the client cancels the call, LowQuery cancels the statement through the driver; on Cassandra, which has no server-side cancel, it only stops waiting. A session that does not stop in time is dropped and a new one is opened for the next call.
The database still decides what its user may do. For production databases, give agents a connection whose database user has only the rights they need: a read-only role is stronger than any client-side check. Side effects the database runs outside the transaction (an Oracle autonomous transaction inside a function, for example) cannot be rolled back by LowQuery.
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index 2077610..ee88d57 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -1,103 +1,116 @@
# Architecture
-LowQuery is a Tauri 2 desktop app. The interface is Svelte 5 with the [CodeAtlas UI](https://ui.codeatlas.com.br/) components; everything that touches a database runs in the Rust process.
+LowQuery is a Go desktop app built on Wails v3. The interface is Svelte 5 with the [CodeAtlas UI](https://ui.codeatlas.com.br/) components; everything that touches a database runs in the Go process.
```
-┌──────────────── WebView (Svelte) ────────────────┐ ┌──────────── Rust (Tauri) ────────────┐
-│ SqlEditor (CodeMirror) split.ts (per dialect) │ │ lib.rs Tauri commands │
-│ QueryView → workspace.svelte.ts (tabs, sessions) │ IPC │ profiles.rs JSON + OS keychain │
-│ ResultGrid (virtualized) explorer.svelte.ts │ ───► │ drivers/mod.rs Session enum │
-│ api.ts (typed invoke wrappers) │ │ postgres.rs + pg_value.rs │
-└──────────────────────────────────────────────────┘ │ oracle.rs │
- └──────────────────────────────────────┘
+┌──────────────── WebView (Svelte) ────────────────┐ ┌───────────────── Go (Wails v3) ─────────────────┐
+│ SqlEditor (CodeMirror) split.ts (per dialect) │ │ main.go window, `lowquery mcp` │
+│ QueryView → workspace.svelte.ts (tabs, sessions) │ Call │ app/ Service.Invoke(cmd, args) │
+│ ResultGrid (virtualized) explorer.svelte.ts │ ────► │ profiles/ JSON + OS credential store │
+│ api.ts (typed wrappers) → host.ts (Wails calls) │ ◄──── │ engines/ opens the driver of an engine │
+└──────────────────────────────────────────────────┘ events│ drivers/ Session interface │
+ │ postgres/ oracle/ mysql/ sqlserver/ ... │
+ └─────────────────────────────────────────────────┘
```
## Principles
-1. **Each database is used the way it is meant to be used.** There is no generic ODBC/JDBC layer. Every engine gets its own driver module that speaks its native protocol, formats its own types and follows its own transaction and script conventions.
-2. **Values cross the IPC boundary as text.** Drivers format each value exactly (NUMERIC and NUMBER keep every digit, dates keep their precision) and send `string | null` plus a column kind (`number`, `text`, `temporal`, ...) the grid uses for alignment. JavaScript numbers never touch database values.
+1. **Each database is used the way it is meant to be used.** There is no generic ODBC/JDBC layer. Every engine gets its own driver package that speaks its native protocol, formats its own types and follows its own transaction and script conventions.
+2. **Values cross into the interface as text.** Drivers format each value exactly (NUMERIC and NUMBER keep every digit, dates keep their precision) and send `string | null` plus a column kind (`number`, `text`, `temporal`, ...) the grid uses for alignment. JavaScript numbers never touch database values.
3. **Row limits are applied by the server.** A `SELECT` on a large table never streams everything just to show 500 rows.
-4. **Secrets stay in the native process.** Passwords go from the connection dialog to the OS credential store and are read back only by Rust.
+4. **Secrets stay in the native process.** Passwords go from the connection dialog to the OS credential store and are read back only by Go.
5. **One session per tab.** Transactions never leak between tabs. The schema browser opens its own session per connection so it does not wait behind a long query.
-## Rust side (`src-tauri/src`)
+## Go side (`main.go`, `internal/`)
-| File | Responsibility |
+| Path | Responsibility |
| --- | --- |
-| `lib.rs` | Tauri commands, session registry, password resolution |
-| `window.rs` | The main window starts hidden and is shown once the page has painted (`window_painted`), with a five-second fallback; `tauri.macos.conf.json` keeps the native traffic lights |
-| `profiles.rs` | `connections.json` in the user config folder; passwords in the keychain (`keyring`) |
-| `model.rs` | Serializable types shared with the interface |
-| `error.rs` | `AppError` with kind, native code, position, detail and hint |
-| `drivers/mod.rs` | `Session` enum that dispatches to each engine |
-| `drivers/postgres.rs` | PostgreSQL session on `tokio-postgres` |
-| `drivers/pg_value.rs` | Binary decoding of PostgreSQL types into server-style text |
-| `drivers/oracle.rs` | Oracle session on the official `oracledb` thin driver |
-| `drivers/mysql.rs` | MySQL and MariaDB session on `mysql_async` |
-| `drivers/sqlserver.rs` | SQL Server and Azure SQL session on `tiberius` (TDS) |
-| `drivers/redis_db.rs` | Redis and Valkey session on `redis-rs` (RESP3) |
-| `drivers/sqlite.rs` | SQLite session on `rusqlite` (bundled engine) |
-| `drivers/cassandra.rs` | Apache Cassandra session on `scylla` (CQL native protocol); `cassandra_tests.rs` holds its tests against a real server |
-| `mcp/` | `lowquery mcp`: MCP server over stdio for AI agents (`server.rs` protocol and sessions, `tools.rs`, `guard.rs` statement checks, `catalog.rs` search/foreign keys/plans per engine, `audit.rs` activity log); see [AI.md](AI.md) |
-| `transfer/` | Export to SQL, CSV and JSON and import from CSV and JSON (`export.rs`, `import.rs`, `sql.rs` literals, `catalog.rs` generated and identity columns, foreign key order) |
-| `ai_setup.rs` | The MCP command and the configuration of each AI client |
-| `import/` | Reads connection files of DBeaver, DataGrip, pgAdmin 4 and SQL Developer (`jdbc.rs` parses JDBC URLs); passwords go from the file to the keychain without reaching the interface |
-| `drivers/tns.rs` | Finds and parses `tnsnames.ora` (TNS_ADMIN, ORACLE_HOME, Windows registry, clients on PATH) |
-| `drivers/integration_tests.rs` | Tests against real servers (`#[ignore]`, see CONTRIBUTING) |
-| `drivers/view_fixtures.rs`, `drivers/ddl_fixtures.rs` | Run the SQL the interface writes (grid sort and filter, tree actions) against each real database |
+| `main.go` | Starts Wails with the embedded `dist/` and one bound service; `lowquery mcp` serves MCP before Wails starts. The frameless main window starts hidden and is shown once the page has painted (`window_painted`), with a five-second fallback; on macOS the hidden-inset title bar keeps the traffic lights |
+| `app/` | The backend the interface calls: one bound method, `Service.Invoke(cmd, args)`, dispatches to a handler per command (the names `api.ts` uses); the session registry; password resolution (typed now, credential store, or none); events to the interface (`transfer-progress`, `update-progress`, `app-menu`) |
+| `model/` | Types shared with the interface; their JSON shape is the contract with `src/lib/api.ts` |
+| `apperr/` | The error every command returns: kind, native code, position, detail and hint |
+| `profiles/` | `connections.json` in the user config folder; passwords in Windows Credential Manager, the macOS Keychain or the Secret Service, under the same names the earlier releases used |
+| `engines/` | Opens a session with the driver of a profile's engine |
+| `drivers/drivers.go` | The `Session` interface every engine implements, `StreamEvent`/`StreamBatch` (500 rows) and `WithFullValues` |
+| `drivers/postgres/` | PostgreSQL session on `pgconn` (pgx); `value.go` decodes the binary format into server-style text |
+| `drivers/oracle/` | Oracle session on `go-ora`, a pure Go driver, so no Oracle Client is installed; `goora.go` reaches a few unexported driver fields (column descriptions, the network session, the fetch size) by reflection; `tns.go` finds and parses `tnsnames.ora` |
+| `drivers/mysql/` | MySQL and MariaDB session: `go-sql-driver/mysql` does the handshake, then `wire.go` speaks the command phase of the protocol |
+| `drivers/sqlserver/` | SQL Server and Azure SQL session on `go-mssqldb` (TDS) |
+| `drivers/sqlite/` | SQLite session on `ncruces/go-sqlite3` (SQLite compiled to Wasm and translated to Go, no cgo) |
+| `drivers/redis/` | Redis and Valkey session on `go-redis` |
+| `drivers/cassandra/` | Apache Cassandra session on `gocql` (`apache/cassandra-gocql-driver/v2`) |
+| `drivers/fixtures/` | Runs the SQL the interface writes (grid sort and filter, tree actions) against each real database |
+| `mcp/` | `lowquery mcp`: MCP server over stdio for AI agents (`server.go` protocol and sessions, `tools.go`, `guard.go` statement checks, `catalog.go` search/foreign keys/plans per engine, `audit.go` activity log); see [AI.md](AI.md) |
+| `transfer/` | Export to SQL, CSV and JSON and import from CSV and JSON (`export.go`, `import.go`, `sql.go` literals, `catalog.go` generated and identity columns, foreign key order) |
+| `aisetup/` | The MCP command and the configuration of each AI client |
+| `importers/` | Reads connection files of DBeaver, DataGrip, pgAdmin 4 and SQL Developer (`jdbc.go` parses JDBC URLs); passwords go from the file to the credential store without reaching the interface |
+| `ojson/` | JSON objects that keep their key order (connection order, other programs' configuration files) |
+| `textcodec/` | Reads text files as UTF-8, UTF-16 with a BOM, or Windows-1252 |
+| `updater/` | Self-update from GitHub Releases (see [Updates](#updates)) |
+| `legacystore/` | Reads the localStorage the Tauri builds kept (editor drafts, export preferences, sidebar width) from the WebView2 LevelDB or the WebKit SQLite files, from a temporary copy; the interface imports the missing entries once (`legacy_storage`, `src/lib/legacy-storage.ts`) |
+| `menubar/` | Turns the menus the page describes (`set_app_menu`) into the native macOS menu bar; clicks come back as `app-menu` events. Windows and Linux keep the menus in the title bar |
+| `tools/updatesign/` | Signs release files for the updater, writing the same `.sig` as `tauri signer sign` |
+
+Driver tests against real servers live next to each driver (`integration_test.go`) and skip unless the engine's `LQ__*` variables are set (see CONTRIBUTING).
### PostgreSQL
-- Each statement is prepared first, which gives column types without executing it.
-- Statements that return rows run inside a short transaction through a portal with `max_rows`, then the transaction commits. In manual-commit mode the portal runs inside the user's transaction.
+- `pgconn` speaks the extended query protocol. Each statement is prepared first, which gives column types without executing it.
+- Statements that return rows run through a portal executed with a row limit (`max_rows` = limit + 1), so the server stops at the limit. In autocommit mode the portal runs in the implicit transaction of its own Sync; in manual-commit mode it runs inside the user's transaction.
+- Results arrive in binary format and are formatted the way the server prints them.
- An error inside a manual transaction rolls it back explicitly, since PostgreSQL rejects every later statement in that transaction anyway.
- Utility commands that cannot run in a transaction block (`VACUUM`, `CREATE DATABASE`, `... CONCURRENTLY`) always run outside one.
-- The connection task collects NOTICE/WARNING messages; cancel uses the server's cancel protocol over a separate connection.
+- NOTICE/WARNING messages are collected and returned with the result. Cancel uses the server's cancel protocol over a separate connection; if the server does not stop within 15 seconds, the connection is cut.
### Oracle
-- The `oracledb` crate is Oracle's pure-Rust thin driver, so no Oracle Client is installed. It is synchronous; every call runs in `spawn_blocking`.
-- `prefetch_rows` and `fetch_array_size` are sized from the row limit, and reading stops at the limit.
+- `go-ora` is a pure Go implementation of the Oracle network protocol, so no Oracle Client is installed.
+- The fetch size is set from the row limit (limit + 1, at most 1000 rows per round trip), and the cursor is closed at the limit without fetching the rest.
- SQL statements lose their trailing `;`, PL/SQL keeps it, and a `/` on its own line ends a block, as in SQL*Plus.
-- `DBMS_OUTPUT` is enabled when the session opens and read after each non-query statement.
-- The driver cannot interrupt a running call yet; a script stops before the next statement instead.
-- TNS aliases are resolved by `tns.rs`, not by the driver: it searches the same places an Oracle client does plus clients on `PATH` and the Windows registry, reads Latin-1 files, follows `IFILE` and applies `NAMES.DEFAULT_DOMAIN`. The driver receives the full descriptor and the folder, which it still uses for `sqlnet.ora`.
+- `go-ora` never commits on its own: with autocommit on, the session commits after DML and PL/SQL.
+- `DBMS_OUTPUT` is enabled when the session opens. After each non-query statement an anonymous block calls `DBMS_OUTPUT.GET_LINE` in a loop and returns the lines through out binds (up to 5000 lines).
+- Cancel cancels the call's context: the server receives a break and stops the running statement or fetch with ORA-01013, and the session stays usable. If the driver loses track of the server's reply, the session reconnects; an open transaction is lost and the error says so.
+- TNS aliases are resolved by `tns.go`, not by the driver: it searches the same places an Oracle client does plus clients on `PATH` and the Windows registry, reads Latin-1 files, follows `IFILE` and applies `NAMES.DEFAULT_DOMAIN`. The driver receives the full descriptor.
### MySQL and MariaDB
-- Statements use the text protocol, so the server formats every value; binary-charset columns are shown as hex.
-- Row-returning statements run with `sql_select_limit` set to the limit and restored afterwards.
+- `go-sql-driver/mysql` only opens the connection (dial, TLS, authentication). The session then takes over the network connection and speaks the command phase itself (`wire.go`), because the driver does not expose column origins, status flags or warning counts.
+- Statements use the text protocol, so the server formats every value; binary-charset columns are shown as `0x...`.
+- Row-returning statements run with `sql_select_limit` set to the limit + 1 and restored afterwards.
- Transaction state comes from the server status flags of the last OK packet.
-- Warnings are read with `SHOW WARNINGS`; cancel sends `KILL QUERY` from a short-lived second connection.
+- Warnings are read with `SHOW WARNINGS` when a statement reports any; cancel sends `KILL QUERY` from a short-lived second connection.
### SQL Server
- Each call is one batch (`GO` splits them in the interface), so `#temp` tables, `USE` and `SET` persist.
-- Plain `SELECT`/`WITH` batches run with `SET ROWCOUNT`; others stop reading at the limit.
+- `go-mssqldb` runs in message mode: result sets come one at a time, and `PRINT` and `RAISERROR` below severity 11 arrive as messages, shown as notices. A statement error does not stop the batch; the first error is reported once the whole response is read.
+- Plain `SELECT`/`WITH` batches run with `SET ROWCOUNT` (limit + 1). Other batches keep the first result set up to the limit and read the rest of the response so the connection stays in sync.
- Manual commit mode uses `SET IMPLICIT_TRANSACTIONS ON`, and `@@TRANCOUNT`/`XACT_STATE()` after each call drive the transaction indicator.
-- Cancel sends a TDS attention. The driver does not expose `PRINT` messages yet.
+- Windows authentication (SSPI, the signed-in account) is available when LowQuery runs on Windows; otherwise the driver signs in with user and password.
+- Cancel sends a TDS attention through the call's context. If the server does not acknowledge it, the connection is reopened.
### SQLite
-- The connection lives behind a mutex and every call runs in `spawn_blocking`; cancel uses `sqlite3_interrupt`.
+- `ncruces/go-sqlite3` runs SQLite without cgo. The connection is used by one call at a time; the row limit stops stepping at limit + 1.
+- Cancel cancels the connection's interrupt context, which SQLite checks from its progress handler while a statement runs.
- Manual commit mode opens `BEGIN` before the first statement; the indicator follows `sqlite3_get_autocommit`.
### Redis
-- Redis is not SQL: each editor line is one redis-cli command, split into arguments with redis-cli quoting rules and sent as is.
-- Replies keep their RESP3 types and are laid out as tables: scalars as one value, maps as field/value, arrays of pairs as columns, `INFO` as section/key/value rows.
+- Redis is not SQL: each editor line is one redis-cli command, split into arguments with redis-cli quoting rules and sent as is through `go-redis`.
+- The connection speaks RESP3 (RESP2 on servers before Redis 6). Replies are parsed from raw RESP, so they keep their types, map order and binary strings, and are laid out as tables: scalars as one value, maps as field/value, arrays of pairs as columns, `INFO` as section/key/value rows.
- The tree lists databases (`db0`...) and up to 1000 keys per database with `SCAN` and `TYPE`; ▶ runs the read command that fits the key type.
- There is no autocommit: `MULTI` opens a queue that the toolbar's EXEC and DISCARD close. Cancel only works for blocking commands, through `CLIENT UNBLOCK` from a second connection.
### Apache Cassandra
-- The `scylla` driver speaks the CQL native protocol to Apache Cassandra 3.x, 4.x and 5.x. Statements are sent as text, unprepared, at consistency `LOCAL_ONE`; contact points are comma separated, and a local datacenter limits requests to its nodes. TLS uses rustls (`prefer` and `require` encrypt without validating the certificate; `verify-full` checks the chain against the system and bundled roots, but not the host name, because the driver connects to the addresses the cluster reports).
-- Rows are read with paging: the page size is derived from the row limit and reading stops at `max_rows + 1`. Values keep their exact CQL text; collections, tuples, UDTs and vectors are valid CQL literals, so a cell can be pasted into an `INSERT`. `cql_literal` turns cell text back into a literal per column type (used by grid edits, export and import).
+- `gocql` speaks the CQL native protocol to Apache Cassandra 3.x, 4.x and 5.x. Statements are sent as text, unprepared (a `/**/` prefix stops gocql from preparing them), at consistency `LOCAL_ONE`; contact points are comma separated, and a local datacenter limits requests to its nodes. `USE` cannot run on a connection pool, so the session reconnects with the new keyspace.
+- TLS: `prefer` tries TLS and falls back to plain TCP; `prefer` and `require` encrypt without validating the certificate; `verify-full` checks the chain against the system roots, but not the host name, because the driver connects to the addresses the cluster reports.
+- Rows are read with paging: the page size is derived from the row limit and reading stops at `max_rows + 1`. Values keep their exact CQL text; collections, tuples, UDTs and vectors are valid CQL literals, so a cell can be pasted into an `INSERT`. `CQLLiteral` turns cell text back into a literal per column type (used by grid edits, export and import).
- There are no transactions: the session is always in autocommit mode (the interface hides the controls), `BEGIN BATCH ... APPLY BATCH` is one statement, and saving grid edits sends one logged batch. CQL writes are upserts, so an UPDATE or DELETE never reports a missing row.
-- CQL has no server-side cancel. Cancel stops waiting (the request future is dropped); the coordinator finishes or times out on its own.
+- CQL has no server-side cancel. Cancel stops waiting; the coordinator finishes or times out on its own.
- Server warnings arrive as messages, like PostgreSQL notices.
- The schema browser reads `system_schema` (and `system_virtual_schema` for the virtual keyspaces of 4.0+): keyspaces are the schemas; tables, materialized views, types, functions and aggregates (named `name(argument types)`, since CQL allows overloads) and indexes are the objects. `DESCRIBE` is a cqlsh command, not part of the protocol, so `object_ddl` builds the `CREATE` statements from the catalog.
-- Result editing: a `SELECT` on one table whose columns include the whole primary key (partition and clustering columns); expressions, aliases, counters, materialized views and system tables are read-only.
- Imports run one `INSERT` per row without a transaction (multi-partition batches are an anti-pattern in Cassandra), so a failed import leaves the rows already written.
## Interface side (`src`)
@@ -106,6 +119,7 @@ LowQuery is a Tauri 2 desktop app. The interface is Svelte 5 with the [CodeAtlas
| --- | --- |
| `lib/engines/` | Engine registry (name, logo, default port, dialect) used by the picker and the sidebar |
| `theme.ts` | LowBloat theme for CodeAtlas: palette, zero radius, no shadows |
+| `lib/host.ts` | The desktop host: backend calls (`Call.ByName` on `Service.Invoke`), events, native dialogs and the window, through the Wails runtime |
| `lib/api.ts` | Types and `invoke` wrappers for every command |
| `lib/sql/split.ts` | Script splitting per dialect: strings, quoted identifiers, nested comments, dollar quotes, `q'[...]'`, PL/SQL blocks |
| `lib/sql/ident.ts` | Identifier quoting and preview queries per engine |
@@ -118,6 +132,8 @@ LowQuery is a Tauri 2 desktop app. The interface is Svelte 5 with the [CodeAtlas
| `lib/state/ai.svelte.ts` | AI agents dialog: client setup and activity |
| `lib/state/importer.svelte.ts` | Import dialog: detected tool files, preview, duplicate check |
| `lib/state/tns.svelte.ts` | Detected `tnsnames.ora` sources and aliases for the connection and import dialogs |
+| `lib/state/updates.svelte.ts` | Update check, download progress and install |
+| `lib/legacy-storage.ts` | One-time import of the Tauri builds' localStorage |
| `lib/components/` | Editor, grid, results, sidebar, dialogs |
| `lib/app-menu.ts`, `lib/components/TitleBar.svelte`, `lib/state/window-frame.svelte.ts` | Title bar and File/Query/View/Help menus (in the title bar on Windows and Linux, in the menu bar on macOS) |
| `lib/dev-mock.ts` | Development-only backend for `bun run dev` in a browser |
@@ -135,38 +151,59 @@ LowQuery is a Tauri 2 desktop app. The interface is Svelte 5 with the [CodeAtlas
| SQLite | The statements kept in `sqlite_schema` for the table, its indexes and triggers |
| Apache Cassandra | `system_schema`: `CREATE TABLE` with its primary key, clustering order and options followed by the table's `CREATE INDEX` statements; materialized views, types, functions, aggregates, indexes and keyspaces |
-The statements the menus and the table designer run come from `lib/sql/ddl.ts`. They run one at a time on the tree's session (never a tab's, so an open transaction in a tab is not touched), and every one is shown before it runs. `ddl.fixtures.json` holds them for a fixed scenario per dialect; `drivers/ddl_fixtures.rs` runs that scenario on every database in CI, including a round trip of the DDL each driver reads back (drop the object, run its DDL, compare the columns).
+The statements the menus and the table designer run come from `lib/sql/ddl.ts`. They run one at a time on the tree's session (never a tab's, so an open transaction in a tab is not touched), and every one is shown before it runs. `lib/sql/ddl.fixtures.json` holds them for a fixed scenario per dialect; `internal/drivers/fixtures` runs that scenario on every database in CI, including a round trip of the DDL each driver reads back (drop the object, run its DDL, compare the columns).
## Export and import
-`transfer/` moves data in and out on a session opened for the job, so the tree and the tabs stay usable:
+`internal/transfer` moves data in and out on a session opened for the job, so the tree and the tabs stay usable:
-- **Reading rows.** `Session::stream` sends the columns and then batches of 500 rows through a channel, straight from each driver's cursor (a PostgreSQL portal in a read-only snapshot, `query_iter` in MySQL, the TDS stream, the Oracle cursor, SQLite steps). Values are formatted as in the grid but in full (`drivers::full_values`: binary values are not cut to the preview size). Dropping the receiver stops the reader; cancel also stops the query on the server.
-- **SQL scripts** (`export.rs`, `sql.rs`): the structure comes from `object_ddl`, tables in foreign key order (`catalog.rs`), foreign keys PostgreSQL and SQL Server script as `ALTER TABLE` moved to the end, MySQL wrapped in `FOREIGN_KEY_CHECKS = 0`. Rows become INSERTs with literals each database reads back exactly (`decode(..., 'hex')`, `0x...`, `HEXTORAW`, `X'...'`, `TIMESTAMP '...'`, CLOB pieces in Oracle, backslashes in MySQL), generated columns left out, and identity columns kept: `OVERRIDING SYSTEM VALUE` and `setval` in PostgreSQL, `SET IDENTITY_INSERT` in SQL Server, `START WITH LIMIT VALUE` in Oracle.
+- **Reading rows.** `Session.Stream` sends the columns and then batches of `StreamBatch` (500) rows, straight from each driver's cursor (a PostgreSQL portal in a read-only snapshot, the MySQL text protocol, the TDS stream, the Oracle cursor, SQLite steps, Cassandra pages). The export runs it under `drivers.WithFullValues`, so values are formatted as in the grid but in full (binary values are not cut to the preview size). Cancelling the job's context stops the reader; cancel also stops the query on the server through `Session.Cancel`.
+- **SQL scripts** (`export.go`, `sql.go`): the structure comes from `object_ddl`, tables in foreign key order (`catalog.go`), foreign keys PostgreSQL and SQL Server script as `ALTER TABLE` moved to the end, MySQL wrapped in `FOREIGN_KEY_CHECKS = 0`. Rows become INSERTs with literals each database reads back exactly (`decode(..., 'hex')`, `0x...`, `HEXTORAW`, `X'...'`, `TIMESTAMP '...'`, CLOB pieces in Oracle, backslashes in MySQL), generated columns left out, and identity columns kept: `OVERRIDING SYSTEM VALUE` and `setval` in PostgreSQL, `SET IDENTITY_INSERT` in SQL Server, `START WITH LIMIT VALUE` in Oracle.
- **CSV and JSON**: one file per table; *CSV for Excel* uses `;`, a BOM and CRLF.
-- **Import** (`import.rs`): the file is decoded (UTF-8, UTF-16, Windows-1252), the delimiter and header detected, columns matched by name, and values converted for the column type (`1.234,56`, `31/12/2024`, `sim`/`não`). Rows go in batches of INSERTs (the same literal writer) in one transaction.
-- `transfer/round_trip.rs` exports a table with awkward values on every database in CI and loads it back from the SQL script, CSV, CSV for Excel and JSON.
+- **Import** (`import.go`): the file is decoded (UTF-8, UTF-16, Windows-1252), the delimiter and header detected, columns matched by name, and values converted for the column type (`1.234,56`, `31/12/2024`, `sim`/`não`). Rows go in batches of INSERTs (the same literal writer) in one transaction.
+- `roundtrip_test.go` exports a table with awkward values on every database in CI and loads it back from the SQL script, CSV, CSV for Excel and JSON.
Scripts are split in the interface so the editor knows where each statement starts. Each statement is a separate command call: results appear as they finish, and an error position maps back to the document.
## Editing results
-A result is editable only when the driver can prove which table row each grid row is. Every driver answers that in `execute` by setting `ExecResult.editable` (table, the table column behind each result column or `null` for expressions, and the result columns that hold the key) or `readOnlyReason`. The key is the primary key, otherwise a unique key whose columns are all NOT NULL. Detection never fails a query and costs at most one extra round trip, usually cached per table on the session.
+A result is editable only when the driver can prove which table row each grid row is. Every driver answers that in `Execute` by setting `ExecResult.editable` (table, the table column behind each result column or `null` for expressions, and the result columns that hold the key) or `readOnlyReason`. The key is the primary key, otherwise a unique key whose columns are all NOT NULL. Detection never fails a query and costs at most one extra round trip, usually cached per table on the session.
| Database | Where the source table comes from | Why a result is read-only |
| --- | --- | --- |
-| PostgreSQL | `table_oid`/`column_id` of the prepared statement; key and types from `pg_index`/`format_type` | Several tables, any join (a self-join reports one OID), UNION, views |
-| Oracle | The SQL is read by a small parser that accepts `SELECT columns FROM table [alias] [WHERE/ORDER BY/FETCH]` only; the names are checked against the result metadata and resolved in the dictionary like Oracle does (schema, then public synonym) | Joins, subqueries, WITH, GROUP BY, set operators, views, database links |
-| MySQL, MariaDB | `org_table`/`org_name`/`schema` of each column plus the alias; key from `information_schema` | Several tables or aliases, set operators, views, temporary tables |
-| SQL Server | `sys.dm_exec_describe_first_result_set` in browse mode, with the keys from `sys.indexes` in the same batch | Several tables or the same table twice, computed and rowversion columns, temp tables |
+| PostgreSQL | Table OID and attribute number of each column in the row description; key and types from `pg_index`/`format_type` | Several tables, any join (a self-join reports one OID), UNION, views |
+| Oracle | The SQL is read by a small parser that accepts `SELECT columns FROM [schema.]table [alias] [WHERE/ORDER BY/FETCH/OFFSET/FOR]` only; the names are checked against the result columns and resolved in the dictionary like Oracle does (schema, then public synonym) | Joins, subqueries in FROM, WITH, DISTINCT, GROUP BY, set operators, hierarchical queries, views, database links |
+| MySQL, MariaDB | `org_table`/`org_name`/`schema` of each column plus the alias, read by `wire.go`; key from `information_schema` | Several tables or aliases, set operators, views, temporary tables |
+| SQL Server | `sys.dm_exec_describe_first_result_set` in browse mode, with the keys from `sys.indexes` in the same batch | Several tables or the same table twice, a table in another database, set operators; computed and rowversion columns are not editable |
| SQLite | Column metadata (`sqlite3_column_table_name`) checked against `EXPLAIN QUERY PLAN`; `rowid` works as the key of a table without one | Compound selects, more than one table scan, results without the key |
-| Apache Cassandra | The table of each result column (the result metadata names it); keys from `system_schema.columns` | Several tables, aliases, counters, views, system tables, results without the whole primary key |
+| Apache Cassandra | The table of each result column (the result metadata names it); keys from `system_schema.columns` | Several tables, aliases, counters, materialized views, system tables, results without the whole primary key |
`apply_changes` receives the target and a list of updates (old key plus new values), deletes and inserts. Each driver builds one statement per change with quoted, schema-qualified names and binds every value, converting the text the grid shows back into the column type the engine's own way (typed binds or explicit conversions that do not depend on session date or number formats). Every UPDATE and DELETE must touch exactly one row. With autocommit on the whole save is one transaction; inside an open transaction it runs behind a savepoint, so a failed save is undone without losing earlier work. After saving, the interface runs the query again to show what the database now holds.
+## Updates
+
+`internal/updater` reads the same `latest.json` manifest and trusts the same minisign public key as the Tauri builds, so Tauri installs and Go installs update from one release.
+
+- `updater.Detect` works out whether this copy can install updates: the Windows setup, a macOS `.app` in a writable folder, a writable AppImage, or a `.deb`/`.rpm` install. The Arch package and portable copies are only told that a new version exists.
+- The package for this platform is downloaded and its signature checked: a Tauri signature (base64 of a minisign signature) whose trusted comment, when it names a version, must match the announced one. The signature is checked again just before install.
+- Install: on Windows the NSIS setup runs with `/P /UPDATE /R` and the app quits; on macOS the new bundle replaces the old one; on Linux the AppImage is replaced, or the `.deb`/`.rpm` goes to `dpkg`/`rpm` through `pkexec`. The app then restarts.
+- `tools/updatesign` signs the release files with the key in `TAURI_SIGNING_PRIVATE_KEY` and refuses a key that does not match `updater.PublicKey` unless `-any-key` is given. The release workflow runs it on every updater file.
+
+## Packaging (`packaging/`)
+
+| Path | Responsibility |
+| --- | --- |
+| `common.sh` | Shared by the build scripts: version, output folders (`build/release/`), the `wails3` tool matching `go.mod` |
+| `windows/` | NSIS setup (`installer.nsi`) and portable zip; the setup installs over a Tauri install in place and keeps its layout and registry values |
+| `macos/` | Universal, ad-hoc signed `LowQuery.app`, as `.app.tar.gz` for the updater and as a `.dmg` |
+| `linux/` | `.deb` and `.rpm` (nfpm, same package name and files as the Tauri packages), AppImage and portable `.tar.gz` |
+| `arch/` | pacman package built with `makepkg` in an Arch container, and the PKGBUILD template for releases |
+| `test/` | `mcp-smoke.sh` checks that `lowquery mcp` answers over stdio; `windows-upgrade.ps1` installs the Tauri setup, upgrades it with the new one and uninstalls, in CI |
+| `icons/` | App icons |
+
## Adding a database engine
1. Open a [database support issue](https://github.com/LowBloat/LowQuery/issues/new?template=database_support.yml) describing the driver and the engine conventions to follow.
-2. Add a module in `src-tauri/src/drivers/` that implements connect, execute (with a server-side row limit), transactions, cancel when the protocol allows it, the metadata queries, and result editing (or a read-only reason for every result); add a variant to `Session`.
-3. Add the engine to `Engine` in `model.rs` and `api.ts`, its connection fields to the dialog, its dialect to `split.ts` and the editor, and its quoting rules to `ident.ts`.
-4. Add integration tests and a CI job with the engine in a container.
+2. Add a package under `internal/drivers/` that implements `drivers.Session`: connect, execute (with a server-side row limit), transactions, cancel when the protocol allows it, the metadata queries, `Stream`, and result editing (or a read-only reason for every result). Add a case to `engines.Open` in `internal/engines`.
+3. Add the engine to `Engine` in `internal/model` and in the interface (`src/lib/engines/`, re-exported by `src/lib/api.ts`), its connection fields to the dialog, its dialect to `split.ts` and the editor, and its quoting rules to `ident.ts`.
+4. Add integration tests that skip unless the engine's `LQ__*` variables are set, and a CI job that runs them with the engine in a container.
diff --git a/go.mod b/go.mod
index 6cb8533..c224a13 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/LowBloat/LowQuery
-go 1.26.4
+go 1.26.11
require (
github.com/apache/cassandra-gocql-driver/v2 v2.2.0
@@ -19,6 +19,7 @@ require (
)
require (
+ aead.dev/minisign v0.3.0
filippo.io/edwards25519 v1.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/coder/websocket v1.8.14 // indirect
@@ -26,11 +27,13 @@ require (
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/godbus/dbus/v5 v5.2.2 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
+ github.com/golang/snappy v0.0.4 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/ncruces/go-sqlite3-wasm/v6 v6.7.35401 // indirect
github.com/ncruces/julianday v1.0.0 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
+ github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d
go.uber.org/atomic v1.12.0 // indirect
golang.org/x/crypto v0.59.0 // indirect
golang.org/x/term v0.48.0 // indirect
diff --git a/go.sum b/go.sum
index 4b9f54c..1a0bef5 100644
--- a/go.sum
+++ b/go.sum
@@ -1,3 +1,5 @@
+aead.dev/minisign v0.3.0 h1:8Xafzy5PEVZqYDNP60yJHARlW1eOQtsKNp/Ph2c0vRA=
+aead.dev/minisign v0.3.0/go.mod h1:NLvG3Uoq3skkRMDuc3YHpWUTMTrSExqm+Ij73W13F6Y=
filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo=
filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.1 h1:zvXfGJCWvywnCA814d8ZiVyt+fm9nnTE8xSb99zRyfo=
@@ -20,17 +22,27 @@ github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/coder/websocket v1.8.14 h1:9L0p0iKiNOibykf283eHkKUHHrpG7f65OE3BhhO7v9g=
github.com/coder/websocket v1.8.14/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg=
github.com/danieljoos/wincred v1.2.3 h1:v7dZC2x32Ut3nEfRH+vhoZGvN72+dQ/snVXo/vMFLdQ=
github.com/danieljoos/wincred v1.2.3/go.mod h1:6qqX0WNrS4RzPZ1tnroDzq9kY3fu1KwE7MRLQK4X0bs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/ebitengine/purego v0.11.1 h1:2zpWRSQNVKN4eKsKO9eM1ILDgWfYMY9GwqRmK6XeQ/0=
github.com/ebitengine/purego v0.11.1/go.mod h1:DCHPP08djqhNSoTfImcnHYQRZmd0qhakvrozqaEYhGQ=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
+github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
+github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
+github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/go-sql-driver/mysql v1.11.0 h1:0dFnuu2mR7g+8Smo/rL18y1WnTLgVrHttzSahf20Gb4=
github.com/go-sql-driver/mysql v1.11.0/go.mod h1:evJsoGjlO/9BFsnfXyjtluDYb3OSGzPNOnUaBl/2Dao=
+github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/godbus/dbus/v5 v5.2.2 h1:TUR3TgtSVDmjiXOgAAyaZbYmIeP3DPkld3jgKGV8mXQ=
github.com/godbus/dbus/v5 v5.2.2/go.mod h1:3AAv2+hPq5rdnr5txxxRwiGjPXamgoIHgz9FPBfOp3c=
github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY=
@@ -39,10 +51,26 @@ github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0kt
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
+github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
@@ -69,6 +97,20 @@ github.com/ncruces/go-sqlite3-wasm/v6 v6.7.35401 h1:BlrYMg6wi+S0oxZ8IeGMHXi2nfjK
github.com/ncruces/go-sqlite3-wasm/v6 v6.7.35401/go.mod h1:K/Z0eKUURoWW9cJ9rHeMGDF0G4pr0A6WizdC+Ohzj54=
github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M=
github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g=
+github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
+github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
+github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
+github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
+github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
+github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
+github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
+github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
+github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
+github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
+github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
+github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
github.com/pierrec/lz4/v4 v4.1.27 h1:+PhzhWDrjRj89TH2sw43nE3+4+W8lSxIuQadEHZyjUk=
github.com/pierrec/lz4/v4 v4.1.27/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
@@ -86,11 +128,16 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
+github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs=
+github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
github.com/wailsapp/wails/v3 v3.1.0 h1:ld0AXSicXiTTsIvmTq3qNn9FzCP8vIHRSJdkRLgaAo8=
github.com/wailsapp/wails/v3 v3.1.0/go.mod h1:tzDY3W1jzN3ksSqfGalTt7K3PwnGfIqtl+IgIXlXz0I=
+github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/zalando/go-keyring v0.2.8 h1:6sD/Ucpl7jNq10rM2pgqTs0sZ9V3qMrqfIIy5YPccHs=
github.com/zalando/go-keyring v0.2.8/go.mod h1:tsMo+VpRq5NGyKfxoBVjCuMrG47yj8cmakZDO5QGii0=
github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
@@ -103,20 +150,82 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c=
golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U=
+golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
+golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY=
golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs=
golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs=
golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.48.0 h1:G6UU1eiSB8nl3DzeUGt7Mg+2SctI8tPS6Z5/mBt6cOk=
golang.org/x/term v0.48.0/go.mod h1:BRDLHCZr2SUjIeBHHpRyQeC9xzSAVbzY2rvKgafnHf4=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo=
golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
+google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
+gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/internal/app/app.go b/internal/app/app.go
index 4611b74..33ff1f7 100644
--- a/internal/app/app.go
+++ b/internal/app/app.go
@@ -24,7 +24,13 @@ type App struct {
profiles *profiles.Store
window Window
emit func(event string, data any)
- jobs transfer.Jobs
+ quit func()
+
+ menuMu sync.Mutex
+ menuBar func([]MenuNode)
+
+ update updateState
+ jobs transfer.Jobs
mu sync.RWMutex
sessions map[string]drivers.Session
@@ -52,6 +58,10 @@ func (a *App) SetWindow(w Window) { a.window = w }
// (transfer progress, for example).
func (a *App) SetEmitter(emit func(event string, data any)) { a.emit = emit }
+// SetQuit connects the function that closes the app (to let an installer
+// replace it, for example).
+func (a *App) SetQuit(quit func()) { a.quit = quit }
+
// Emit sends an event to the interface; without an emitter it does nothing.
func (a *App) Emit(event string, data any) {
if a.emit != nil {
diff --git a/internal/app/commands.go b/internal/app/commands.go
index f55a80e..e0a0748 100644
--- a/internal/app/commands.go
+++ b/internal/app/commands.go
@@ -192,17 +192,11 @@ func (a *App) commands() map[string]handler {
}) (any, error) {
return nil, revealInFolder(p.Path)
}),
- // Self-update arrives with the installers; until then this build
- // only learns about new versions.
- "update_policy": command(func(ctx context.Context, _ none) (map[string]any, error) {
- return map[string]any{"channel": "portable", "canInstall": false, "target": nil}, nil
- }),
- "update_check": command(func(ctx context.Context, _ none) (*availableUpdate, error) {
- return a.checkUpdate(ctx)
- }),
}
a.transferCommands(m)
a.integrationCommands(m)
+ a.updateCommands(m)
+ a.desktopCommands(m)
return m
}
diff --git a/internal/app/desktop_commands.go b/internal/app/desktop_commands.go
new file mode 100644
index 0000000..2fc87f1
--- /dev/null
+++ b/internal/app/desktop_commands.go
@@ -0,0 +1,26 @@
+package app
+
+import (
+ "context"
+
+ "github.com/LowBloat/LowQuery/internal/legacystore"
+)
+
+// desktopCommands adds commands for the desktop shell: the macOS menu bar
+// and the editor drafts kept by the previous (Tauri) builds.
+func (a *App) desktopCommands(m map[string]handler) {
+ // set_app_menu {about: {id, label}, menus: [{label, entries: [{id, label,
+ // accelerator?, disabled?, checked?} | {separator: true}]}]} replaces the
+ // macOS menu bar; clicks come back as the app-menu event, {id}. Does
+ // nothing on Windows and Linux.
+ m["set_app_menu"] = command(func(ctx context.Context, d MenuBarDescription) (any, error) {
+ a.applyMenuBar(d)
+ return nil, nil
+ })
+ // legacy_storage returns {key: value} for the localStorage entries the
+ // Tauri builds kept (drafts, export preferences, sidebar width), {} when
+ // there are none. It never fails.
+ m["legacy_storage"] = command(func(ctx context.Context, _ none) (map[string]string, error) {
+ return legacystore.Read(), nil
+ })
+}
diff --git a/internal/app/menu.go b/internal/app/menu.go
new file mode 100644
index 0000000..c423d56
--- /dev/null
+++ b/internal/app/menu.go
@@ -0,0 +1,217 @@
+package app
+
+import (
+ "log"
+ "strconv"
+ "strings"
+ "unicode"
+)
+
+// The macOS menu bar. The interface describes its menus (set_app_menu) and
+// sends the description again whenever their state changes; the shell
+// replaces the native menu bar with the MenuNode tree BuildMenuBar makes and
+// reports clicks as MenuEvent with the entry's id. Windows and Linux keep the
+// menus the page draws in its title bar, and have no menu bar to set.
+
+// MenuEvent is emitted with a MenuClick when an entry of the menu bar is
+// chosen.
+const MenuEvent = "app-menu"
+
+// MenuClick is the payload of MenuEvent.
+type MenuClick struct {
+ ID string `json:"id"`
+}
+
+// MenuBarDescription is what set_app_menu receives: the About item and the
+// app's own menus, which go between the standard Edit and Window menus.
+type MenuBarDescription struct {
+ About MenuEntryDescription `json:"about"`
+ Menus []MenuDescription `json:"menus"`
+}
+
+type MenuDescription struct {
+ Label string `json:"label"`
+ Entries []MenuEntryDescription `json:"entries"`
+}
+
+// MenuEntryDescription is an item, a check box (Checked set) or a separator.
+type MenuEntryDescription struct {
+ Separator bool `json:"separator,omitempty"`
+ ID string `json:"id,omitempty"`
+ Label string `json:"label,omitempty"`
+ // Accelerator in Wails notation: "CmdOrCtrl+Shift+Enter", "F5".
+ Accelerator string `json:"accelerator,omitempty"`
+ Disabled bool `json:"disabled,omitempty"`
+ Checked *bool `json:"checked,omitempty"`
+}
+
+type MenuKind int
+
+const (
+ MenuItemKind MenuKind = iota
+ MenuCheckboxKind
+ MenuSeparatorKind
+ MenuSubmenuKind
+ // MenuRoleKind is a standard item the system implements (Copy, Hide,
+ // Quit, ...).
+ MenuRoleKind
+)
+
+// MenuRole names a standard item of the macOS menu bar.
+type MenuRole string
+
+const (
+ RoleServices MenuRole = "services"
+ RoleHide MenuRole = "hide"
+ RoleHideOthers MenuRole = "hideOthers"
+ RoleShowAll MenuRole = "showAll"
+ RoleQuit MenuRole = "quit"
+ RoleUndo MenuRole = "undo"
+ RoleRedo MenuRole = "redo"
+ RoleCut MenuRole = "cut"
+ RoleCopy MenuRole = "copy"
+ RolePaste MenuRole = "paste"
+ RoleSelectAll MenuRole = "selectAll"
+ RoleMinimise MenuRole = "minimise"
+ RoleZoom MenuRole = "zoom"
+ RoleFullscreen MenuRole = "fullscreen"
+ RoleBringAllToFront MenuRole = "bringAllToFront"
+)
+
+// MenuNode is one entry of the native menu bar, independent of the toolkit.
+type MenuNode struct {
+ Kind MenuKind
+ Role MenuRole
+ ID string
+ Label string
+ Accelerator string
+ Disabled bool
+ Checked bool
+ Children []MenuNode
+}
+
+func roleNode(r MenuRole) MenuNode { return MenuNode{Kind: MenuRoleKind, Role: r} }
+
+var separatorNode = MenuNode{Kind: MenuSeparatorKind}
+
+// BuildMenuBar makes the macOS menu bar: the application menu (About,
+// Services, Hide, Quit), the standard Edit menu, so Command+C and friends
+// keep working in text fields, the described menus, and the standard Window
+// menu.
+func BuildMenuBar(appName string, d MenuBarDescription) []MenuNode {
+ var appMenu []MenuNode
+ if d.About.ID != "" {
+ label := d.About.Label
+ if label == "" {
+ label = "About " + appName
+ }
+ appMenu = append(appMenu, MenuNode{Kind: MenuItemKind, ID: d.About.ID, Label: label}, separatorNode)
+ }
+ appMenu = append(appMenu,
+ roleNode(RoleServices), separatorNode,
+ roleNode(RoleHide), roleNode(RoleHideOthers), roleNode(RoleShowAll), separatorNode,
+ roleNode(RoleQuit))
+
+ bar := []MenuNode{
+ {Kind: MenuSubmenuKind, Label: appName, Children: appMenu},
+ {Kind: MenuSubmenuKind, Label: "Edit", Children: []MenuNode{
+ roleNode(RoleUndo), roleNode(RoleRedo), separatorNode,
+ roleNode(RoleCut), roleNode(RoleCopy), roleNode(RolePaste), roleNode(RoleSelectAll),
+ }},
+ }
+ for _, m := range d.Menus {
+ if strings.TrimSpace(m.Label) == "" {
+ continue
+ }
+ bar = append(bar, MenuNode{Kind: MenuSubmenuKind, Label: m.Label, Children: menuEntries(m.Entries)})
+ }
+ return append(bar, MenuNode{Kind: MenuSubmenuKind, Label: "Window", Children: []MenuNode{
+ roleNode(RoleMinimise), roleNode(RoleZoom), roleNode(RoleFullscreen), separatorNode,
+ roleNode(RoleBringAllToFront),
+ }})
+}
+
+// menuEntries translates described entries, dropping those without an id
+// or label and separators at the edges or next to each other.
+func menuEntries(entries []MenuEntryDescription) []MenuNode {
+ out := []MenuNode{}
+ for _, e := range entries {
+ if e.Separator {
+ if len(out) > 0 && out[len(out)-1].Kind != MenuSeparatorKind {
+ out = append(out, separatorNode)
+ }
+ continue
+ }
+ if e.ID == "" || e.Label == "" {
+ continue
+ }
+ n := MenuNode{Kind: MenuItemKind, ID: e.ID, Label: e.Label, Disabled: e.Disabled}
+ if e.Checked != nil {
+ n.Kind = MenuCheckboxKind
+ n.Checked = *e.Checked
+ }
+ if e.Accelerator != "" {
+ if ValidAccelerator(e.Accelerator) {
+ n.Accelerator = e.Accelerator
+ } else {
+ log.Printf("menu %q: ignoring invalid accelerator %q", e.Label, e.Accelerator)
+ }
+ }
+ out = append(out, n)
+ }
+ for len(out) > 0 && out[len(out)-1].Kind == MenuSeparatorKind {
+ out = out[:len(out)-1]
+ }
+ return out
+}
+
+// Modifiers and named keys Wails accepts in an accelerator
+// (pkg/application/keys.go); it reports any other as an error.
+var (
+ acceleratorModifiers = map[string]bool{
+ "cmdorctrl": true, "cmd": true, "command": true, "ctrl": true,
+ "optionoralt": true, "alt": true, "option": true, "shift": true, "super": true,
+ }
+ acceleratorKeys = map[string]bool{
+ "plus": true, "backspace": true, "tab": true, "return": true, "enter": true,
+ "escape": true, "left": true, "right": true, "up": true, "down": true,
+ "space": true, "delete": true, "forward delete": true, "home": true,
+ "end": true, "page up": true, "page down": true, "numlock": true,
+ }
+)
+
+// ValidAccelerator reports whether Wails can parse s: modifiers joined by
+// "+", then a named key, a function key F1-F35 or one printable character.
+func ValidAccelerator(s string) bool {
+ parts := strings.Split(s, "+")
+ for _, m := range parts[:len(parts)-1] {
+ if !acceleratorModifiers[strings.ToLower(m)] {
+ return false
+ }
+ }
+ key := strings.ToLower(parts[len(parts)-1])
+ if acceleratorKeys[key] {
+ return true
+ }
+ if n, err := strconv.Atoi(strings.TrimPrefix(key, "f")); err == nil && strings.HasPrefix(key, "f") && n >= 1 && n <= 35 && !strings.HasPrefix(key, "f0") {
+ return true
+ }
+ return len(key) == 1 && unicode.IsPrint(rune(key[0]))
+}
+
+// SetMenuBar connects the function that replaces the native menu bar. main.go
+// sets it on macOS; elsewhere it stays nil and set_app_menu does nothing.
+func (a *App) SetMenuBar(set func([]MenuNode)) {
+ a.menuMu.Lock()
+ a.menuBar = set
+ a.menuMu.Unlock()
+}
+
+func (a *App) applyMenuBar(d MenuBarDescription) {
+ a.menuMu.Lock()
+ set := a.menuBar
+ a.menuMu.Unlock()
+ if set != nil {
+ set(BuildMenuBar("LowQuery", d))
+ }
+}
diff --git a/internal/app/menu_test.go b/internal/app/menu_test.go
new file mode 100644
index 0000000..d73e8bb
--- /dev/null
+++ b/internal/app/menu_test.go
@@ -0,0 +1,165 @@
+package app
+
+import (
+ "context"
+ "encoding/json"
+ "reflect"
+ "testing"
+)
+
+func labels(nodes []MenuNode) []string {
+ out := make([]string, len(nodes))
+ for i, n := range nodes {
+ switch n.Kind {
+ case MenuSeparatorKind:
+ out[i] = "-"
+ case MenuRoleKind:
+ out[i] = "role:" + string(n.Role)
+ default:
+ out[i] = n.Label
+ }
+ }
+ return out
+}
+
+// The description the interface sends (src/lib/app-menu.ts).
+const description = `{
+ "about": {"id": "about", "label": "About LowQuery"},
+ "menus": [
+ {"label": "File", "entries": [
+ {"separator": true},
+ {"id": "file/New query", "label": "New query", "accelerator": "CmdOrCtrl+T"},
+ {"separator": true},
+ {"separator": true},
+ {"id": "file/Close tab", "label": "Close tab", "accelerator": "CmdOrCtrl+W", "disabled": true},
+ {"id": "file/Bad", "label": "Bad", "accelerator": "Hyper+K"},
+ {"id": "", "label": "No id"},
+ {"separator": true}
+ ]},
+ {"label": "Query", "entries": [
+ {"id": "query/Run script", "label": "Run script", "accelerator": "F5"},
+ {"id": "query/Run statement", "label": "Run statement", "accelerator": "CmdOrCtrl+Enter"},
+ {"id": "query/Auto-commit", "label": "Auto-commit", "checked": true, "disabled": true},
+ {"id": "query/Off", "label": "Off", "checked": false}
+ ]},
+ {"label": "", "entries": []}
+ ]
+}`
+
+func TestBuildMenuBar(t *testing.T) {
+ var d MenuBarDescription
+ if err := json.Unmarshal([]byte(description), &d); err != nil {
+ t.Fatal(err)
+ }
+ bar := BuildMenuBar("LowQuery", d)
+ if got, want := labels(bar), []string{"LowQuery", "Edit", "File", "Query", "Window"}; !reflect.DeepEqual(got, want) {
+ t.Fatalf("menus %q, want %q", got, want)
+ }
+ for _, m := range bar {
+ if m.Kind != MenuSubmenuKind {
+ t.Errorf("%s is not a submenu", m.Label)
+ }
+ }
+ if got, want := labels(bar[0].Children), []string{"About LowQuery", "-", "role:services", "-", "role:hide", "role:hideOthers", "role:showAll", "-", "role:quit"}; !reflect.DeepEqual(got, want) {
+ t.Errorf("app menu %q, want %q", got, want)
+ }
+ if bar[0].Children[0].ID != "about" {
+ t.Errorf("about id %q", bar[0].Children[0].ID)
+ }
+ if got, want := labels(bar[1].Children), []string{"role:undo", "role:redo", "-", "role:cut", "role:copy", "role:paste", "role:selectAll"}; !reflect.DeepEqual(got, want) {
+ t.Errorf("edit menu %q, want %q", got, want)
+ }
+ if got, want := labels(bar[4].Children), []string{"role:minimise", "role:zoom", "role:fullscreen", "-", "role:bringAllToFront"}; !reflect.DeepEqual(got, want) {
+ t.Errorf("window menu %q, want %q", got, want)
+ }
+
+ file := bar[2].Children
+ wantFile := []MenuNode{
+ {Kind: MenuItemKind, ID: "file/New query", Label: "New query", Accelerator: "CmdOrCtrl+T"},
+ separatorNode,
+ {Kind: MenuItemKind, ID: "file/Close tab", Label: "Close tab", Accelerator: "CmdOrCtrl+W", Disabled: true},
+ // An accelerator Wails cannot parse is dropped, not the item.
+ {Kind: MenuItemKind, ID: "file/Bad", Label: "Bad"},
+ }
+ if !reflect.DeepEqual(file, wantFile) {
+ t.Errorf("file menu\n%+v\nwant\n%+v", file, wantFile)
+ }
+ query := bar[3].Children
+ wantQuery := []MenuNode{
+ {Kind: MenuItemKind, ID: "query/Run script", Label: "Run script", Accelerator: "F5"},
+ {Kind: MenuItemKind, ID: "query/Run statement", Label: "Run statement", Accelerator: "CmdOrCtrl+Enter"},
+ {Kind: MenuCheckboxKind, ID: "query/Auto-commit", Label: "Auto-commit", Checked: true, Disabled: true},
+ {Kind: MenuCheckboxKind, ID: "query/Off", Label: "Off"},
+ }
+ if !reflect.DeepEqual(query, wantQuery) {
+ t.Errorf("query menu\n%+v\nwant\n%+v", query, wantQuery)
+ }
+}
+
+func TestBuildMenuBarWithoutAbout(t *testing.T) {
+ bar := BuildMenuBar("LowQuery", MenuBarDescription{})
+ if got := labels(bar[0].Children)[0]; got != "role:services" {
+ t.Errorf("first app menu item %q", got)
+ }
+ if len(bar) != 3 {
+ t.Errorf("%d menus", len(bar))
+ }
+}
+
+func TestValidAccelerator(t *testing.T) {
+ for s, want := range map[string]bool{
+ "CmdOrCtrl+T": true,
+ "CmdOrCtrl+Shift+Enter": true,
+ "F5": true,
+ "F35": true,
+ "F36": false,
+ "F0": false,
+ "f": true,
+ "Alt+Page Up": true,
+ "Ctrl+Plus": true,
+ "CmdOrCtrl+": false,
+ "Hyper+K": false,
+ "PageUp": false,
+ "": false,
+ } {
+ if got := ValidAccelerator(s); got != want {
+ t.Errorf("%q: %v, want %v", s, got, want)
+ }
+ }
+}
+
+func TestSetAppMenuCommand(t *testing.T) {
+ a := New("test", nil)
+ var got []MenuNode
+ a.SetMenuBar(func(nodes []MenuNode) { got = nodes })
+ defer a.SetMenuBar(nil)
+ h := a.commands()["set_app_menu"]
+ if _, err := h(context.Background(), json.RawMessage(description)); err != nil {
+ t.Fatal(err)
+ }
+ if len(got) != 5 || got[3].Label != "Query" {
+ t.Fatalf("menu bar %q", labels(got))
+ }
+ // Without a menu bar (Windows, Linux) the command does nothing.
+ a.SetMenuBar(nil)
+ if _, err := h(context.Background(), json.RawMessage(description)); err != nil {
+ t.Fatal(err)
+ }
+}
+
+func TestLegacyStorageCommand(t *testing.T) {
+ // Point every OS's lookup at an empty folder: no old install, {}.
+ empty := t.TempDir()
+ t.Setenv("LOCALAPPDATA", empty)
+ t.Setenv("HOME", empty)
+ t.Setenv("USERPROFILE", empty)
+ t.Setenv("XDG_DATA_HOME", empty)
+ out, err := New("test", nil).commands()["legacy_storage"](context.Background(), nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ b, _ := json.Marshal(out)
+ if string(b) != "{}" {
+ t.Fatalf("got %s", b)
+ }
+}
diff --git a/internal/app/update_commands.go b/internal/app/update_commands.go
new file mode 100644
index 0000000..155cc9e
--- /dev/null
+++ b/internal/app/update_commands.go
@@ -0,0 +1,36 @@
+package app
+
+import (
+ "context"
+
+ "github.com/LowBloat/LowQuery/internal/updater"
+)
+
+// updateCommands adds the self-update commands:
+//
+// update_policy -> {channel, canInstall, target}
+// update_check -> {version, notes} | null
+// update_download {version} -> {version, notes}, with `update-progress`
+// events {version, received, total|null}
+// update_install -> null; the app restarts
+// update_cancel -> null; stops a running download
+func (a *App) updateCommands(m map[string]handler) {
+ m["update_policy"] = command(func(ctx context.Context, _ none) (updater.Policy, error) {
+ return a.updatePolicy(), nil
+ })
+ m["update_check"] = command(func(ctx context.Context, _ none) (*availableUpdate, error) {
+ return a.checkUpdate(ctx)
+ })
+ m["update_download"] = command(func(ctx context.Context, p struct {
+ Version string `json:"version"`
+ }) (*availableUpdate, error) {
+ return a.downloadUpdate(ctx, p.Version)
+ })
+ m["update_install"] = command(func(ctx context.Context, _ none) (any, error) {
+ return nil, a.installUpdate(ctx)
+ })
+ m["update_cancel"] = command(func(ctx context.Context, _ none) (any, error) {
+ a.cancelUpdateDownload()
+ return nil, nil
+ })
+}
diff --git a/internal/app/updates.go b/internal/app/updates.go
index bcc1bf2..937137c 100644
--- a/internal/app/updates.go
+++ b/internal/app/updates.go
@@ -2,52 +2,271 @@ package app
import (
"context"
- "encoding/json"
- "net/http"
+ "errors"
+ "os"
+ "path/filepath"
"strconv"
"strings"
+ "sync"
"time"
"github.com/LowBloat/LowQuery/internal/apperr"
+ "github.com/LowBloat/LowQuery/internal/updater"
)
-// latestManifest is the update manifest every release publishes.
-const latestManifest = "https://github.com/LowBloat/LowQuery/releases/latest/download/latest.json"
+// Where updates come from and the key they are checked with; tests point
+// them at a local server and a throwaway key.
+var (
+ manifestURL = updater.ManifestURL
+ updatePublicKey = updater.PublicKey
+ detectPolicy = updater.DetectCurrent
+ updateDir = func(version string) string {
+ return filepath.Join(os.TempDir(), "LowQuery-update", version)
+ }
+)
-// A check that hangs (a network that changed under it, a sleeping laptop)
-// would otherwise keep every later check waiting.
-const updateCheckTimeout = 30 * time.Second
+const (
+ // A check that hangs (a network that changed under it, a sleeping
+ // laptop) would otherwise keep every later check waiting.
+ updateCheckTimeout = 30 * time.Second
+ // A download stops when nothing arrives for this long, or when it has
+ // not finished after the second limit.
+ updateStallTimeout = 60 * time.Second
+ updateDownloadTimeout = 30 * time.Minute
+)
type availableUpdate struct {
Version string `json:"version"`
Notes string `json:"notes"`
}
+// updateProgress is the payload of the `update-progress` event. Total is
+// null when the server does not send the size.
+type updateProgress struct {
+ Version string `json:"version"`
+ Received int64 `json:"received"`
+ Total *int64 `json:"total"`
+}
+
+// updateState is the self-update state of one App: the policy, the manifest
+// of the last check, the running download and the verified package.
+type updateState struct {
+ mu sync.Mutex
+ policy *updater.Policy
+ manifest *updater.Manifest
+ job *downloadJob
+ ready *updater.Package
+}
+
+type downloadJob struct {
+ version string
+ cancel context.CancelFunc
+ done chan struct{}
+ pkg *updater.Package
+ err error
+}
+
+func (a *App) updates() *updateState { return &a.update }
+
+// updatePolicy detects once whether this copy can install updates.
+func (a *App) updatePolicy() updater.Policy {
+ u := a.updates()
+ u.mu.Lock()
+ defer u.mu.Unlock()
+ if u.policy == nil {
+ p := detectPolicy()
+ u.policy = &p
+ }
+ return *u.policy
+}
+
// checkUpdate returns the latest release when it is newer than this build.
func (a *App) checkUpdate(ctx context.Context) (*availableUpdate, error) {
ctx, cancel := context.WithTimeout(ctx, updateCheckTimeout)
defer cancel()
- req, err := http.NewRequestWithContext(ctx, http.MethodGet, latestManifest, nil)
+ m, err := updater.FetchManifest(ctx, nil, manifestURL)
if err != nil {
- return nil, apperr.Internalf("%v", err)
+ return nil, apperr.Connectionf("Could not check for updates: %v", err)
+ }
+ u := a.updates()
+ u.mu.Lock()
+ u.manifest = m
+ u.mu.Unlock()
+ if !newerVersion(m.Version, a.version) {
+ return nil, nil
+ }
+ return &availableUpdate{Version: m.Version, Notes: m.Notes}, nil
+}
+
+// downloadUpdate downloads and verifies the update to version (or a newer
+// one, if a release came out since the check). A call for the version
+// already downloading waits for that download; a call for another version
+// cancels it.
+func (a *App) downloadUpdate(ctx context.Context, version string) (*availableUpdate, error) {
+ policy := a.updatePolicy()
+ if !policy.CanInstall {
+ return nil, apperr.New(apperr.Invalid, updater.ErrCannotInstall.Error())
+ }
+ version = strings.TrimPrefix(version, "v")
+ u := a.updates()
+ u.mu.Lock()
+ if r := u.ready; r != nil && r.Version == version && fileExists(r.Path) {
+ u.mu.Unlock()
+ return &availableUpdate{Version: r.Version, Notes: r.Notes}, nil
+ }
+ job := u.job
+ if job == nil || job.version != version {
+ if job != nil {
+ job.cancel()
+ }
+ job = a.startDownload(u, version, policy)
+ }
+ u.mu.Unlock()
+
+ select {
+ case <-job.done:
+ case <-ctx.Done():
+ return nil, apperr.CancelledErr()
+ }
+ if job.err != nil {
+ if errors.Is(job.err, context.Canceled) {
+ return nil, apperr.CancelledErr()
+ }
+ var e *apperr.Error
+ if errors.As(job.err, &e) {
+ return nil, e
+ }
+ return nil, apperr.Connectionf("Could not download the update: %v", job.err)
}
- resp, err := http.DefaultClient.Do(req)
+ return &availableUpdate{Version: job.pkg.Version, Notes: job.pkg.Notes}, nil
+}
+
+// startDownload runs a download job in the background. Called with u.mu held.
+func (a *App) startDownload(u *updateState, version string, policy updater.Policy) *downloadJob {
+ ctx, cancel := context.WithTimeout(context.Background(), updateDownloadTimeout)
+ job := &downloadJob{version: version, cancel: cancel, done: make(chan struct{})}
+ u.job = job
+ manifest := u.manifest
+ target := ""
+ if policy.Target != nil {
+ target = *policy.Target
+ }
+ go func() {
+ defer cancel()
+ job.pkg, job.err = a.runDownload(ctx, manifest, version, target)
+ u.mu.Lock()
+ if u.job == job {
+ u.job = nil
+ if job.err == nil {
+ u.ready = job.pkg
+ }
+ }
+ u.mu.Unlock()
+ close(job.done)
+ }()
+ return job
+}
+
+func (a *App) runDownload(ctx context.Context, m *updater.Manifest, version, target string) (*updater.Package, error) {
+ if m == nil || m.Version != version {
+ var err error
+ m, err = updater.FetchManifest(ctx, nil, manifestURL)
+ if err != nil {
+ return nil, err
+ }
+ }
+ if !newerVersion(m.Version, a.version) {
+ return nil, apperr.New(apperr.NotFound, "LowQuery is up to date.")
+ }
+ dir := updateDir(m.Version)
+ removeOtherDownloads(dir)
+ return updater.Download(ctx, updater.DownloadOptions{
+ Manifest: m,
+ Target: target,
+ Dir: dir,
+ PublicKey: updatePublicKey,
+ StallTimeout: updateStallTimeout,
+ OnProgress: func(p updater.Progress) {
+ ev := updateProgress{Version: m.Version, Received: p.Received}
+ if p.Total > 0 {
+ ev.Total = &p.Total
+ }
+ a.Emit(updater.ProgressEvent, ev)
+ },
+ })
+}
+
+// removeOtherDownloads deletes packages of other versions next to dir.
+func removeOtherDownloads(dir string) {
+ parent := filepath.Dir(dir)
+ entries, err := os.ReadDir(parent)
if err != nil {
- return nil, apperr.Connectionf("Could not check for updates: %v", err)
+ return
}
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- return nil, apperr.Connectionf("Could not check for updates: %s", resp.Status)
+ for _, e := range entries {
+ if e.IsDir() && e.Name() != filepath.Base(dir) {
+ _ = os.RemoveAll(filepath.Join(parent, e.Name()))
+ }
}
- var latest availableUpdate
- if err := json.NewDecoder(resp.Body).Decode(&latest); err != nil {
- return nil, apperr.Connectionf("Could not read the update manifest: %v", err)
+}
+
+// cancelUpdateDownload stops a running download.
+func (a *App) cancelUpdateDownload() {
+ u := a.updates()
+ u.mu.Lock()
+ defer u.mu.Unlock()
+ if u.job != nil {
+ u.job.cancel()
}
- if !newerVersion(latest.Version, a.version) {
- return nil, nil
+}
+
+// installUpdate installs the downloaded update and restarts: the Windows
+// setup restarts the app itself; elsewhere the new copy is started here.
+// Either way this copy then quits.
+func (a *App) installUpdate(ctx context.Context) error {
+ policy := a.updatePolicy()
+ if !policy.CanInstall {
+ return apperr.New(apperr.Invalid, updater.ErrCannotInstall.Error())
+ }
+ u := a.updates()
+ u.mu.Lock()
+ job, pkg := u.job, u.ready
+ u.mu.Unlock()
+ // Still downloading, or the download was deleted since (temp cleanup):
+ // download first.
+ if job != nil || (pkg != nil && !fileExists(pkg.Path)) {
+ version := ""
+ if job != nil {
+ version = job.version
+ } else {
+ version = pkg.Version
+ }
+ if _, err := a.downloadUpdate(ctx, version); err != nil {
+ return err
+ }
+ u.mu.Lock()
+ pkg = u.ready
+ u.mu.Unlock()
}
- latest.Version = strings.TrimPrefix(latest.Version, "v")
- return &latest, nil
+ if pkg == nil {
+ return apperr.New(apperr.Invalid, "Download the update first.")
+ }
+ if err := updater.Install(pkg, policy, updatePublicKey); err != nil {
+ return apperr.Internalf("Could not install the update: %v", err)
+ }
+ if err := updater.Relaunch(policy); err != nil {
+ return apperr.Internalf("LowQuery %s is installed. Restart LowQuery to use it (%v).", pkg.Version, err)
+ }
+ if a.quit != nil {
+ // After the reply, so the interface is not left waiting.
+ go a.quit()
+ }
+ return nil
+}
+
+func fileExists(path string) bool {
+ info, err := os.Stat(path)
+ return err == nil && !info.IsDir()
}
// newerVersion reports whether semver a is newer than b. Pre-release and
diff --git a/internal/app/updates_test.go b/internal/app/updates_test.go
index 1ef5831..cdc94e9 100644
--- a/internal/app/updates_test.go
+++ b/internal/app/updates_test.go
@@ -1,6 +1,21 @@
package app
-import "testing"
+import (
+ "context"
+ "encoding/json"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "strconv"
+ "sync"
+ "sync/atomic"
+ "testing"
+ "time"
+
+ "github.com/LowBloat/LowQuery/internal/apperr"
+ "github.com/LowBloat/LowQuery/internal/updater"
+)
func TestNewerVersion(t *testing.T) {
cases := []struct {
@@ -21,3 +36,211 @@ func TestNewerVersion(t *testing.T) {
}
}
}
+
+// updateServer serves latest.json for version 2.0.0 and its package,
+// signed with the throwaway key of the updater tests.
+type updateServer struct {
+ *httptest.Server
+ requests atomic.Int32
+ stall chan struct{}
+}
+
+func newUpdateServer(t *testing.T, policy updater.Policy) *updateServer {
+ t.Helper()
+ testdata := filepath.Join("..", "updater", "testdata")
+ keyText, err := os.ReadFile(filepath.Join(testdata, "throwaway.key"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ pub, _ := os.ReadFile(filepath.Join(testdata, "throwaway.key.pub"))
+ key, err := updater.LoadSecretKey(string(keyText), "throwaway-pass")
+ if err != nil {
+ t.Fatal(err)
+ }
+ asset := make([]byte, 200<<10)
+ copy(asset, "MZ")
+ file := filepath.Join(t.TempDir(), "LowQuery-2.0.0-windows-x64-setup.exe")
+ if err := os.WriteFile(file, asset, 0o644); err != nil {
+ t.Fatal(err)
+ }
+ sig, err := updater.SignFile(key, file, "2.0.0", time.Now())
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ us := &updateServer{}
+ mux := http.NewServeMux()
+ mux.HandleFunc("/latest.json", func(w http.ResponseWriter, r *http.Request) {
+ p := updater.Platform{URL: "http://" + r.Host + "/asset/" + filepath.Base(file), Signature: sig}
+ _ = json.NewEncoder(w).Encode(updater.Manifest{Version: "v2.0.0", Notes: "What's new", Platforms: map[string]updater.Platform{
+ "windows-x86_64": p, "windows-x86_64-nsis": p, "darwin-aarch64": p, "darwin-x86_64": p, "linux-x86_64-deb": p,
+ }})
+ })
+ mux.HandleFunc("/asset/", func(w http.ResponseWriter, r *http.Request) {
+ us.requests.Add(1)
+ w.Header().Set("Content-Length", strconv.Itoa(len(asset)))
+ if us.stall != nil {
+ _, _ = w.Write(asset[:1000])
+ w.(http.Flusher).Flush()
+ select {
+ case <-us.stall:
+ case <-r.Context().Done():
+ }
+ return
+ }
+ _, _ = w.Write(asset)
+ })
+ us.Server = httptest.NewServer(mux)
+ t.Cleanup(us.Close)
+
+ dir := t.TempDir()
+ saved := []any{manifestURL, updatePublicKey, detectPolicy, updateDir}
+ manifestURL = us.URL + "/latest.json"
+ updatePublicKey = string(pub)
+ detectPolicy = func() updater.Policy { return policy }
+ updateDir = func(version string) string { return filepath.Join(dir, version) }
+ t.Cleanup(func() {
+ manifestURL = saved[0].(string)
+ updatePublicKey = saved[1].(string)
+ detectPolicy = saved[2].(func() updater.Policy)
+ updateDir = saved[3].(func(string) string)
+ })
+ return us
+}
+
+var installable = updater.Policy{Channel: "deb", CanInstall: true, Target: func() *string { s := "linux-x86_64-deb"; return &s }()}
+
+type events struct {
+ mu sync.Mutex
+ list []updateProgress
+}
+
+func (e *events) emit(name string, data any) {
+ if name != updater.ProgressEvent {
+ return
+ }
+ e.mu.Lock()
+ defer e.mu.Unlock()
+ e.list = append(e.list, data.(updateProgress))
+}
+
+func (e *events) count() int {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+ return len(e.list)
+}
+
+func TestUpdateCheckDownload(t *testing.T) {
+ us := newUpdateServer(t, installable)
+ a := New("1.0.0", nil)
+ ev := &events{}
+ a.SetEmitter(ev.emit)
+ ctx := context.Background()
+
+ if p := a.updatePolicy(); p.Channel != "deb" || !p.CanInstall {
+ t.Fatalf("policy %+v", p)
+ }
+ found, err := a.checkUpdate(ctx)
+ if err != nil || found == nil || found.Version != "2.0.0" || found.Notes != "What's new" {
+ t.Fatalf("check: %+v %v", found, err)
+ }
+
+ // Two requests at once (background prefetch and the dialog): one download.
+ var wg sync.WaitGroup
+ results := make([]*availableUpdate, 2)
+ errs := make([]error, 2)
+ for i := range 2 {
+ wg.Add(1)
+ go func() {
+ defer wg.Done()
+ results[i], errs[i] = a.downloadUpdate(ctx, "2.0.0")
+ }()
+ }
+ wg.Wait()
+ for i := range 2 {
+ if errs[i] != nil || results[i].Version != "2.0.0" {
+ t.Fatalf("download %d: %+v %v", i, results[i], errs[i])
+ }
+ }
+ if n := us.requests.Load(); n != 1 {
+ t.Fatalf("%d downloads", n)
+ }
+ last := ev.list[len(ev.list)-1]
+ if last.Version != "2.0.0" || last.Total == nil || last.Received != *last.Total {
+ t.Fatalf("last progress %+v", last)
+ }
+ ready := a.updates().ready
+ if ready == nil || filepath.Base(ready.Path) != "LowQuery-2.0.0-windows-x64-setup.exe" || ready.Target != "linux-x86_64-deb" {
+ t.Fatalf("ready %+v", ready)
+ }
+ // Already downloaded.
+ if _, err := a.downloadUpdate(ctx, "2.0.0"); err != nil || us.requests.Load() != 1 {
+ t.Fatalf("again: %v, %d downloads", err, us.requests.Load())
+ }
+}
+
+func TestUpdateDownloadCancel(t *testing.T) {
+ us := newUpdateServer(t, installable)
+ us.stall = make(chan struct{})
+ defer close(us.stall)
+ a := New("1.0.0", nil)
+ ev := &events{}
+ a.SetEmitter(ev.emit)
+
+ done := make(chan error, 1)
+ go func() {
+ _, err := a.downloadUpdate(context.Background(), "2.0.0")
+ done <- err
+ }()
+ deadline := time.Now().Add(5 * time.Second)
+ for ev.count() < 1 && time.Now().Before(deadline) {
+ time.Sleep(10 * time.Millisecond)
+ }
+ a.cancelUpdateDownload()
+ select {
+ case err := <-done:
+ if e := apperr.From(err); e.Kind != apperr.Cancelled {
+ t.Fatalf("got %v", err)
+ }
+ case <-time.After(5 * time.Second):
+ t.Fatal("cancel did not stop the download")
+ }
+ if a.updates().ready != nil {
+ t.Fatal("cancelled download marked ready")
+ }
+}
+
+func TestUpdateRefusals(t *testing.T) {
+ newUpdateServer(t, updater.Policy{Channel: "portable"})
+ ctx := context.Background()
+
+ // Up to date.
+ current := New("2.0.0", nil)
+ if found, err := current.checkUpdate(ctx); err != nil || found != nil {
+ t.Fatalf("check: %+v %v", found, err)
+ }
+ // A copy that cannot install neither downloads nor installs.
+ a := New("1.0.0", nil)
+ if _, err := a.downloadUpdate(ctx, "2.0.0"); apperr.From(err).Kind != apperr.Invalid {
+ t.Fatalf("download: %v", err)
+ }
+ if err := a.installUpdate(ctx); apperr.From(err).Kind != apperr.Invalid {
+ t.Fatalf("install: %v", err)
+ }
+}
+
+func TestUpdateInstallNeedsDownload(t *testing.T) {
+ newUpdateServer(t, installable)
+ a := New("1.0.0", nil)
+ quit := false
+ a.SetQuit(func() { quit = true })
+ err := a.installUpdate(context.Background())
+ if err == nil || apperr.From(err).Message != "Download the update first." || quit {
+ t.Fatalf("got %v, quit %v", err, quit)
+ }
+ // Up to date: the download says so.
+ b := New("2.0.0", nil)
+ if _, err := b.downloadUpdate(context.Background(), "2.0.0"); apperr.From(err).Kind != apperr.NotFound {
+ t.Fatalf("got %v", err)
+ }
+}
diff --git a/internal/legacystore/legacystore.go b/internal/legacystore/legacystore.go
new file mode 100644
index 0000000..aaa38a0
--- /dev/null
+++ b/internal/legacystore/legacystore.go
@@ -0,0 +1,173 @@
+// Package legacystore reads what the Tauri builds of LowQuery kept in their
+// webview's localStorage (editor drafts, export preferences, sidebar width),
+// so the Go build, which runs on another origin and data folder, can carry it
+// over on its first start.
+//
+// Where the Tauri builds kept it:
+//
+// - Windows (WebView2, origin http://tauri.localhost): a Chromium LevelDB at
+// %LOCALAPPDATA%\dev.lowbloat.lowquery\EBWebView\Default\Local Storage\leveldb.
+// - macOS (WKWebView, origin tauri://localhost): SQLite files under
+// ~/Library/WebKit/dev.lowbloat.lowquery/WebsiteData, either the legacy
+// LocalStorage/tauri_localhost_0.localstorage or, with WebKit's unified
+// origin storage, Default///LocalStorage/localstorage.sqlite3.
+// - Linux (WebKitGTK, origin tauri://localhost): the same SQLite files under
+// ~/.local/share/dev.lowbloat.lowquery (localstorage/ or storage/).
+//
+// Every source is read from a temporary copy, never in place: the old app
+// may still be running and holding it.
+package legacystore
+
+import (
+ "bytes"
+ "errors"
+ "fmt"
+ "io"
+ "io/fs"
+ "log"
+ "os"
+ "path/filepath"
+ "runtime"
+ "strings"
+ "unicode/utf16"
+)
+
+// Keys are the localStorage entries carried over, and the only ones read.
+var Keys = []string{
+ "lowquery.tabs.v1", // editor drafts (src/lib/state/workspace.svelte.ts)
+ "lowquery.export.v1", // export preferences (src/lib/state/transfer.svelte.ts)
+ "lowquery.sidebar.width", // sidebar width (src/App.svelte)
+}
+
+// identifier is the Tauri bundle identifier, which named the data folders.
+const identifier = "dev.lowbloat.lowquery"
+
+// Read returns the Keys found in the Tauri builds' storage on this machine,
+// or an empty map. It never fails: problems are logged.
+func Read() map[string]string {
+ found, err := read(runtime.GOOS, environment())
+ if err != nil {
+ log.Printf("legacy storage: %v", err)
+ }
+ if found == nil {
+ found = map[string]string{}
+ }
+ return found
+}
+
+// env holds the folders the sources are found from.
+type env struct {
+ home, localAppData, xdgDataHome string
+}
+
+func environment() env {
+ home, _ := os.UserHomeDir()
+ return env{home: home, localAppData: os.Getenv("LOCALAPPDATA"), xdgDataHome: os.Getenv("XDG_DATA_HOME")}
+}
+
+func read(goos string, e env) (map[string]string, error) {
+ switch goos {
+ case "windows":
+ if e.localAppData == "" {
+ return nil, nil
+ }
+ dir := filepath.Join(e.localAppData, identifier, "EBWebView", "Default", "Local Storage", "leveldb")
+ return ReadLevelDB(dir, ChromiumOrigins)
+ case "darwin", "linux":
+ found := map[string]string{}
+ var errs []error
+ for _, db := range FindWebKitDatabases(webKitRoots(goos, e)) {
+ values, err := ReadWebKit(db)
+ if err != nil {
+ errs = append(errs, err)
+ continue
+ }
+ for k, v := range values {
+ if _, seen := found[k]; !seen {
+ found[k] = v
+ }
+ }
+ }
+ return found, errors.Join(errs...)
+ }
+ return nil, nil
+}
+
+// webKitRoots are the folders that may hold the WebKit storage of the Tauri
+// builds, most likely first.
+func webKitRoots(goos string, e env) []string {
+ if e.home == "" {
+ return nil
+ }
+ if goos == "darwin" {
+ // WebKit names the folder after the bundle identifier; an unbundled
+ // binary gets its process name instead.
+ lib := filepath.Join(e.home, "Library", "WebKit")
+ return []string{filepath.Join(lib, identifier), filepath.Join(lib, "lowquery"), filepath.Join(lib, "LowQuery")}
+ }
+ data := e.xdgDataHome
+ if data == "" {
+ data = filepath.Join(e.home, ".local", "share")
+ }
+ return []string{filepath.Join(data, identifier), filepath.Join(data, "lowquery")}
+}
+
+// wanted reports whether key is one of Keys.
+func wanted(key string) bool {
+ for _, k := range Keys {
+ if k == key {
+ return true
+ }
+ }
+ return false
+}
+
+// decodeUTF16LE decodes little-endian UTF-16, the encoding WebKit and
+// Chromium store strings in.
+func decodeUTF16LE(b []byte) (string, error) {
+ if len(b)%2 != 0 {
+ return "", fmt.Errorf("odd UTF-16 length %d", len(b))
+ }
+ units := make([]uint16, len(b)/2)
+ for i := range units {
+ units[i] = uint16(b[2*i]) | uint16(b[2*i+1])<<8
+ }
+ return string(utf16.Decode(units)), nil
+}
+
+// decodeLatin1 decodes ISO-8859-1: each byte is the code point.
+func decodeLatin1(b []byte) string {
+ var sb strings.Builder
+ sb.Grow(len(b))
+ for _, c := range b {
+ sb.WriteRune(rune(c))
+ }
+ return sb.String()
+}
+
+// copyFile copies src to dst. A missing source is not an error when
+// optional is set.
+func copyFile(src, dst string, optional bool) error {
+ in, err := os.Open(src)
+ if err != nil {
+ if optional && errors.Is(err, fs.ErrNotExist) {
+ return nil
+ }
+ return err
+ }
+ defer in.Close()
+ out, err := os.Create(dst)
+ if err != nil {
+ return err
+ }
+ if _, err := io.Copy(out, in); err != nil {
+ out.Close()
+ return err
+ }
+ return out.Close()
+}
+
+// containsFold reports whether b contains s, ignoring ASCII case.
+func containsFold(b []byte, s string) bool {
+ return bytes.Contains(bytes.ToLower(b), []byte(strings.ToLower(s)))
+}
diff --git a/internal/legacystore/legacystore_test.go b/internal/legacystore/legacystore_test.go
new file mode 100644
index 0000000..e0eb6ab
--- /dev/null
+++ b/internal/legacystore/legacystore_test.go
@@ -0,0 +1,329 @@
+package legacystore
+
+import (
+ "os"
+ "path/filepath"
+ "reflect"
+ "sort"
+ "strings"
+ "testing"
+ "unicode/utf16"
+
+ "github.com/ncruces/go-sqlite3"
+ "github.com/syndtr/goleveldb/leveldb"
+)
+
+const drafts = `{"drafts":[{"id":"a","title":"Query 1","sql":"select 'ação' -- ✓"}],"active":"a"}`
+
+func utf16le(s string) []byte {
+ units := utf16.Encode([]rune(s))
+ b := make([]byte, 2*len(units))
+ for i, u := range units {
+ b[2*i], b[2*i+1] = byte(u), byte(u>>8)
+ }
+ return b
+}
+
+func latin1(s string) []byte {
+ b := make([]byte, 0, len(s))
+ for _, r := range s {
+ b = append(b, byte(r))
+ }
+ return b
+}
+
+// chromium encodes s the way Chromium's localStorage does: Latin-1 when it
+// fits, UTF-16LE otherwise.
+func chromium(s string) []byte {
+ for _, r := range s {
+ if r > 0xff {
+ return append([]byte{chromiumUTF16}, utf16le(s)...)
+ }
+ }
+ return append([]byte{chromiumLatin1}, latin1(s)...)
+}
+
+func chromiumKey(origin, key string) []byte {
+ return append([]byte("_"+origin+"\x00"), chromium(key)...)
+}
+
+func writeLevelDB(t *testing.T, dir string, entries map[string][]byte) {
+ t.Helper()
+ db, err := leveldb.OpenFile(dir, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for k, v := range entries {
+ if err := db.Put([]byte(k), v, nil); err != nil {
+ t.Fatal(err)
+ }
+ }
+ if err := db.Close(); err != nil {
+ t.Fatal(err)
+ }
+}
+
+func TestReadLevelDB(t *testing.T) {
+ dir := t.TempDir()
+ writeLevelDB(t, dir, map[string][]byte{
+ "VERSION": []byte("1"),
+ "META:http://tauri.localhost": {0x08, 0x01},
+ string(chromiumKey("http://tauri.localhost", "lowquery.tabs.v1")): chromium(drafts),
+ string(chromiumKey("http://tauri.localhost", "lowquery.sidebar.width")): chromium("312"),
+ string(chromiumKey("http://tauri.localhost", "lowquery.theme")): chromium("dark"),
+ // Another origin's value for a wanted key is not ours.
+ string(chromiumKey("http://localhost:1420", "lowquery.export.v1")): chromium(`{"format":"csv"}`),
+ // A UTF-16 key.
+ "_http://tauri.localhost\x00\x00" + string(utf16le("lowquery.export.v1")): chromium(`{"format":"sql","content":"all"}`),
+ })
+ got, err := ReadLevelDB(dir, ChromiumOrigins)
+ if err != nil {
+ t.Fatal(err)
+ }
+ want := map[string]string{
+ "lowquery.tabs.v1": drafts,
+ "lowquery.sidebar.width": "312",
+ "lowquery.export.v1": `{"format":"sql","content":"all"}`,
+ }
+ if !reflect.DeepEqual(got, want) {
+ t.Fatalf("got %q\nwant %q", got, want)
+ }
+ // The original is read through a copy: its lock stays as it was.
+ if _, err := os.Stat(filepath.Join(dir, "LOCK")); err != nil {
+ t.Fatal(err)
+ }
+}
+
+// The old app may be running and hold the database: the copy leaves its
+// LOCK out, and the latest writes are still in the unflushed log.
+func TestReadLevelDBWhileOpen(t *testing.T) {
+ dir := t.TempDir()
+ db, err := leveldb.OpenFile(dir, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer db.Close()
+ if err := db.Put(chromiumKey("http://tauri.localhost", "lowquery.sidebar.width"), chromium("300"), nil); err != nil {
+ t.Fatal(err)
+ }
+ got, err := ReadLevelDB(dir, ChromiumOrigins)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if got["lowquery.sidebar.width"] != "300" {
+ t.Fatalf("got %q", got)
+ }
+}
+
+func TestReadLevelDBMissing(t *testing.T) {
+ got, err := ReadLevelDB(filepath.Join(t.TempDir(), "none"), ChromiumOrigins)
+ if err != nil || len(got) != 0 {
+ t.Fatalf("got %q, %v", got, err)
+ }
+}
+
+func TestDecodeChromium(t *testing.T) {
+ for _, s := range []string{"", "plain", "ação", "✓ 漢字 😀"} {
+ got, err := decodeChromium(chromium(s))
+ if err != nil || got != s {
+ t.Errorf("%q: got %q, %v", s, got, err)
+ }
+ }
+ if _, err := decodeChromium([]byte{0x07, 'x'}); err == nil {
+ t.Error("unknown format accepted")
+ }
+ if _, err := decodeChromium([]byte{chromiumUTF16, 'x'}); err == nil {
+ t.Error("odd UTF-16 accepted")
+ }
+}
+
+// writeWebKit creates a WebKit localStorage database with values stored the
+// way WebKit stores them: key as TEXT, value as a UTF-16LE BLOB.
+func writeWebKit(t *testing.T, path string, items map[string]string, wal bool) (closeDB func()) {
+ t.Helper()
+ if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ conn, err := sqlite3.Open(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if wal {
+ if err := conn.Exec(`PRAGMA journal_mode=WAL; PRAGMA wal_autocheckpoint=0`); err != nil {
+ t.Fatal(err)
+ }
+ }
+ if err := conn.Exec(`CREATE TABLE ItemTable (key TEXT UNIQUE ON CONFLICT REPLACE, value BLOB NOT NULL ON CONFLICT FAIL)`); err != nil {
+ t.Fatal(err)
+ }
+ stmt, _, err := conn.Prepare(`INSERT INTO ItemTable VALUES (?, ?)`)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for k, v := range items {
+ if err := stmt.BindText(1, k); err != nil {
+ t.Fatal(err)
+ }
+ if err := stmt.BindBlob(2, utf16le(v)); err != nil {
+ t.Fatal(err)
+ }
+ if err := stmt.Exec(); err != nil {
+ t.Fatal(err)
+ }
+ }
+ if err := stmt.Close(); err != nil {
+ t.Fatal(err)
+ }
+ return func() { conn.Close() }
+}
+
+func TestReadWebKit(t *testing.T) {
+ path := filepath.Join(t.TempDir(), legacyFileName)
+ writeWebKit(t, path, map[string]string{
+ "lowquery.tabs.v1": drafts,
+ "lowquery.export.v1": `{"format":"csv","content":"data"}`,
+ "lowquery.sidebar.width": "250",
+ "other": "x",
+ }, false)()
+ got, err := ReadWebKit(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ want := map[string]string{
+ "lowquery.tabs.v1": drafts,
+ "lowquery.export.v1": `{"format":"csv","content":"data"}`,
+ "lowquery.sidebar.width": "250",
+ }
+ if !reflect.DeepEqual(got, want) {
+ t.Fatalf("got %q\nwant %q", got, want)
+ }
+}
+
+// With the old app running, the latest writes may be only in the WAL.
+func TestReadWebKitWAL(t *testing.T) {
+ path := filepath.Join(t.TempDir(), unifiedFileName)
+ closeDB := writeWebKit(t, path, map[string]string{"lowquery.sidebar.width": "222"}, true)
+ defer closeDB()
+ if _, err := os.Stat(path + "-wal"); err != nil {
+ t.Skipf("no WAL file: %v", err)
+ }
+ got, err := ReadWebKit(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if got["lowquery.sidebar.width"] != "222" {
+ t.Fatalf("got %q", got)
+ }
+}
+
+func TestFindWebKitDatabases(t *testing.T) {
+ home := t.TempDir()
+ mac := filepath.Join(home, "Library", "WebKit", identifier, "WebsiteData")
+ legacy := filepath.Join(mac, "LocalStorage", legacyFileName)
+ unified := filepath.Join(mac, "Default", "XXsalted", "YYsalted", "LocalStorage", unifiedFileName)
+ other := filepath.Join(mac, "Default", "AAother", "BBother", "LocalStorage", unifiedFileName)
+ unknown := filepath.Join(mac, "Default", "CC", "DD", "LocalStorage", unifiedFileName)
+ for _, p := range []string{legacy, unified, other, unknown} {
+ if err := os.MkdirAll(filepath.Dir(p), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(p, nil, 0o644); err != nil {
+ t.Fatal(err)
+ }
+ }
+ // WebKit's serialized origins: protocol, host and port of the top and
+ // frame origins.
+ origin := func(dir string, s string) {
+ if err := os.WriteFile(filepath.Join(dir, "origin"), []byte(s), 0o644); err != nil {
+ t.Fatal(err)
+ }
+ }
+ origin(filepath.Join(mac, "Default", "XXsalted", "YYsalted"), "\x05\x00\x00\x00tauri\x09\x00\x00\x00localhost\x00\x05\x00\x00\x00tauri\x09\x00\x00\x00localhost\x00")
+ origin(filepath.Join(mac, "Default", "AAother", "BBother"), "\x05\x00\x00\x00https\x0b\x00\x00\x00example.com\x00")
+
+ got := FindWebKitDatabases(webKitRoots("darwin", env{home: home}))
+ want := []string{unified, legacy, unknown}
+ if !reflect.DeepEqual(got, want) {
+ t.Fatalf("got %q\nwant %q", got, want)
+ }
+}
+
+func TestReadMacAndLinux(t *testing.T) {
+ for _, goos := range []string{"darwin", "linux"} {
+ t.Run(goos, func(t *testing.T) {
+ home := t.TempDir()
+ var legacyPath, unifiedDir string
+ if goos == "darwin" {
+ base := filepath.Join(home, "Library", "WebKit", identifier, "WebsiteData")
+ legacyPath = filepath.Join(base, "LocalStorage", legacyFileName)
+ unifiedDir = filepath.Join(base, "Default", "h1", "h2")
+ } else {
+ base := filepath.Join(home, ".local", "share", identifier)
+ legacyPath = filepath.Join(base, "localstorage", legacyFileName)
+ unifiedDir = filepath.Join(base, "storage", "h1", "h2")
+ }
+ // The unified database wins for a key both have; the legacy file
+ // fills in what it lacks.
+ writeWebKit(t, filepath.Join(unifiedDir, "LocalStorage", unifiedFileName), map[string]string{"lowquery.tabs.v1": drafts}, false)()
+ if err := os.WriteFile(filepath.Join(unifiedDir, "origin"), []byte("tauri localhost"), 0o644); err != nil {
+ t.Fatal(err)
+ }
+ writeWebKit(t, legacyPath, map[string]string{"lowquery.tabs.v1": "old", "lowquery.sidebar.width": "260"}, false)()
+
+ got, err := read(goos, env{home: home})
+ if err != nil {
+ t.Fatal(err)
+ }
+ want := map[string]string{"lowquery.tabs.v1": drafts, "lowquery.sidebar.width": "260"}
+ if !reflect.DeepEqual(got, want) {
+ t.Fatalf("got %q\nwant %q", got, want)
+ }
+ })
+ }
+}
+
+func TestReadWindows(t *testing.T) {
+ local := t.TempDir()
+ dir := filepath.Join(local, identifier, "EBWebView", "Default", "Local Storage", "leveldb")
+ if err := os.MkdirAll(dir, 0o755); err != nil {
+ t.Fatal(err)
+ }
+ writeLevelDB(t, dir, map[string][]byte{string(chromiumKey("http://tauri.localhost", "lowquery.tabs.v1")): chromium(drafts)})
+ got, err := read("windows", env{localAppData: local})
+ if err != nil || got["lowquery.tabs.v1"] != drafts {
+ t.Fatalf("got %q, %v", got, err)
+ }
+ // Nothing installed: empty, no error.
+ got, err = read("windows", env{localAppData: t.TempDir()})
+ if err != nil || len(got) != 0 {
+ t.Fatalf("got %q, %v", got, err)
+ }
+}
+
+// TestRealLevelDB checks a copy of a real Tauri WebView2 localStorage folder,
+// named by LQ_LEGACY_LEVELDB. It prints key names and value sizes only: the
+// drafts are the user's SQL.
+func TestRealLevelDB(t *testing.T) {
+ dir := os.Getenv("LQ_LEGACY_LEVELDB")
+ if dir == "" {
+ t.Skip("LQ_LEGACY_LEVELDB not set")
+ }
+ got, err := ReadLevelDB(dir, ChromiumOrigins)
+ if err != nil {
+ t.Fatal(err)
+ }
+ keys := make([]string, 0, len(got))
+ for k := range got {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+ for _, k := range keys {
+ t.Logf("%s: %d characters", k, len([]rune(got[k])))
+ }
+ if len(got) == 0 {
+ t.Error("no keys found")
+ }
+ if v, ok := got["lowquery.tabs.v1"]; ok && !strings.HasPrefix(v, "{") {
+ t.Error("drafts are not JSON")
+ }
+}
diff --git a/internal/legacystore/leveldb.go b/internal/legacystore/leveldb.go
new file mode 100644
index 0000000..1554cb4
--- /dev/null
+++ b/internal/legacystore/leveldb.go
@@ -0,0 +1,115 @@
+package legacystore
+
+import (
+ "errors"
+ "fmt"
+ "io/fs"
+ "os"
+ "path/filepath"
+ "strings"
+
+ "github.com/syndtr/goleveldb/leveldb"
+ "github.com/syndtr/goleveldb/leveldb/opt"
+ "github.com/syndtr/goleveldb/leveldb/util"
+)
+
+// ChromiumOrigins are the origins the Tauri builds served the interface from
+// in WebView2: http://tauri.localhost, or https:// with useHttpsScheme.
+var ChromiumOrigins = []string{"http://tauri.localhost", "https://tauri.localhost"}
+
+// Chromium's localStorage LevelDB keeps each item under
+//
+// "_" + origin + "\x00" + encoded key
+//
+// and an encoded string (key or value) is one format byte followed by the
+// characters: 0x01 for Latin-1, one byte each; 0x00 for UTF-16LE.
+const (
+ chromiumUTF16 = 0x00
+ chromiumLatin1 = 0x01
+)
+
+// ReadLevelDB returns the Keys stored for any of origins in the Chromium
+// localStorage LevelDB at dir. A missing folder yields an empty map.
+func ReadLevelDB(dir string, origins []string) (map[string]string, error) {
+ if _, err := os.Stat(dir); err != nil {
+ if errors.Is(err, fs.ErrNotExist) {
+ return map[string]string{}, nil
+ }
+ return nil, err
+ }
+ tmp, err := os.MkdirTemp("", "lowquery-legacy-leveldb-")
+ if err != nil {
+ return nil, err
+ }
+ defer os.RemoveAll(tmp)
+ if err := copyLevelDB(dir, tmp); err != nil {
+ return nil, fmt.Errorf("copying %s: %w", dir, err)
+ }
+ db, err := leveldb.OpenFile(tmp, &opt.Options{ReadOnly: true, ErrorIfMissing: true})
+ if err != nil {
+ // A copy taken while the old app was writing may need its manifest
+ // rebuilt; the copy is ours to repair.
+ db, err = leveldb.RecoverFile(tmp, nil)
+ if err != nil {
+ return nil, fmt.Errorf("opening %s: %w", dir, err)
+ }
+ }
+ defer db.Close()
+
+ found := map[string]string{}
+ for _, origin := range origins {
+ prefix := []byte("_" + origin + "\x00")
+ it := db.NewIterator(util.BytesPrefix(prefix), nil)
+ for it.Next() {
+ key, err := decodeChromium(it.Key()[len(prefix):])
+ if err != nil || !wanted(key) {
+ continue
+ }
+ if _, seen := found[key]; seen {
+ continue
+ }
+ value, err := decodeChromium(it.Value())
+ if err != nil {
+ return nil, fmt.Errorf("value of %s: %w", key, err)
+ }
+ found[key] = value
+ }
+ it.Release()
+ if err := it.Error(); err != nil {
+ return nil, err
+ }
+ }
+ return found, nil
+}
+
+// copyLevelDB copies the database files of src into dst, leaving out LOCK,
+// which the old app may hold, and the text logs.
+func copyLevelDB(src, dst string) error {
+ entries, err := os.ReadDir(src)
+ if err != nil {
+ return err
+ }
+ for _, e := range entries {
+ name := e.Name()
+ if !e.Type().IsRegular() || name == "LOCK" || name == "LOG" || strings.HasPrefix(name, "LOG.") {
+ continue
+ }
+ if err := copyFile(filepath.Join(src, name), filepath.Join(dst, name), true); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func decodeChromium(b []byte) (string, error) {
+ if len(b) == 0 {
+ return "", errors.New("empty string encoding")
+ }
+ switch b[0] {
+ case chromiumLatin1:
+ return decodeLatin1(b[1:]), nil
+ case chromiumUTF16:
+ return decodeUTF16LE(b[1:])
+ }
+ return "", fmt.Errorf("unknown string format 0x%02x", b[0])
+}
diff --git a/internal/legacystore/webkit.go b/internal/legacystore/webkit.go
new file mode 100644
index 0000000..e749c4e
--- /dev/null
+++ b/internal/legacystore/webkit.go
@@ -0,0 +1,147 @@
+package legacystore
+
+import (
+ "errors"
+ "fmt"
+ "io/fs"
+ "os"
+ "path/filepath"
+ "strings"
+
+ "github.com/ncruces/go-sqlite3"
+)
+
+// WebKit (macOS and WebKitGTK) keeps localStorage in SQLite:
+//
+// CREATE TABLE ItemTable (key TEXT UNIQUE ON CONFLICT REPLACE,
+// value BLOB NOT NULL ON CONFLICT FAIL)
+//
+// with each value stored as UTF-16 (native order, little-endian on every Mac
+// and PC WebKit runs on). Two layouts exist:
+//
+// - legacy: one file per origin in the localStorage folder, named after the
+// origin's database identifier, tauri_localhost_0.localstorage;
+// - unified origin storage (WebKit 2.38+/Safari 16.x+): one folder per
+// origin, //, holding an
+// "origin" file with the serialized origins and
+// LocalStorage/localstorage.sqlite3. WebKit moves a legacy file there the
+// first time the origin's storage is opened.
+const (
+ unifiedFileName = "localstorage.sqlite3"
+ legacyFileName = "tauri_localhost_0.localstorage"
+ // How deep under a root the files are looked for: unified storage sits at
+ // WebsiteData/Default///LocalStorage/localstorage.sqlite3.
+ maxSearchDepth = 7
+)
+
+// FindWebKitDatabases lists the WebKit localStorage databases of the Tauri
+// origin (tauri://localhost) under roots, the most likely first: unified
+// storage whose origin file names tauri, then legacy files, then unified
+// storage without an origin file.
+func FindWebKitDatabases(roots []string) []string {
+ var tauri, legacy, unknown []string
+ for _, root := range roots {
+ _ = filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error {
+ if err != nil {
+ if path == root {
+ return filepath.SkipDir
+ }
+ return nil
+ }
+ if d.IsDir() {
+ if depth(root, path) > maxSearchDepth {
+ return filepath.SkipDir
+ }
+ return nil
+ }
+ switch name := d.Name(); {
+ case name == legacyFileName:
+ legacy = append(legacy, path)
+ case name == unifiedFileName:
+ // /LocalStorage/localstorage.sqlite3
+ origin, err := os.ReadFile(filepath.Join(filepath.Dir(filepath.Dir(path)), "origin"))
+ switch {
+ case err != nil:
+ unknown = append(unknown, path)
+ case containsFold(origin, "tauri"):
+ tauri = append(tauri, path)
+ }
+ }
+ return nil
+ })
+ }
+ return append(append(tauri, legacy...), unknown...)
+}
+
+func depth(root, path string) int {
+ rel, err := filepath.Rel(root, path)
+ if err != nil || rel == "." {
+ return 0
+ }
+ return strings.Count(rel, string(filepath.Separator)) + 1
+}
+
+// ReadWebKit returns the Keys found in the WebKit localStorage database at
+// path, read from a copy opened read-only.
+func ReadWebKit(path string) (map[string]string, error) {
+ tmp, err := os.MkdirTemp("", "lowquery-legacy-webkit-")
+ if err != nil {
+ return nil, err
+ }
+ defer os.RemoveAll(tmp)
+ copyPath := filepath.Join(tmp, "localstorage.sqlite3")
+ if err := copyFile(path, copyPath, false); err != nil {
+ return nil, fmt.Errorf("copying %s: %w", path, err)
+ }
+ // The write-ahead log may hold the latest writes.
+ for _, suffix := range []string{"-wal", "-shm", "-journal"} {
+ if err := copyFile(path+suffix, copyPath+suffix, true); err != nil {
+ return nil, fmt.Errorf("copying %s%s: %w", path, suffix, err)
+ }
+ }
+ values, err := readItemTable(copyPath)
+ if err != nil {
+ return nil, fmt.Errorf("reading %s: %w", path, err)
+ }
+ return values, nil
+}
+
+func readItemTable(path string) (found map[string]string, err error) {
+ conn, err := sqlite3.OpenFlags(path, sqlite3.OPEN_READONLY)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { err = errors.Join(err, conn.Close()) }()
+ stmt, _, err := conn.Prepare(`SELECT key, value FROM ItemTable`)
+ if err != nil {
+ return nil, err
+ }
+ defer stmt.Close()
+ found = map[string]string{}
+ for stmt.Step() {
+ key, err := webKitString(stmt, 0)
+ if err != nil || !wanted(key) {
+ continue
+ }
+ value, err := webKitString(stmt, 1)
+ if err != nil {
+ return nil, fmt.Errorf("value of %s: %w", key, err)
+ }
+ found[key] = value
+ }
+ return found, stmt.Err()
+}
+
+// webKitString reads a column WebKit wrote: TEXT as SQLite returns it, a BLOB
+// as UTF-16LE.
+func webKitString(stmt *sqlite3.Stmt, col int) (string, error) {
+ switch stmt.ColumnType(col) {
+ case sqlite3.BLOB:
+ return decodeUTF16LE(stmt.ColumnRawBlob(col))
+ case sqlite3.TEXT:
+ return stmt.ColumnText(col), nil
+ case sqlite3.NULL:
+ return "", errors.New("null")
+ }
+ return stmt.ColumnText(col), nil
+}
diff --git a/internal/menubar/menubar.go b/internal/menubar/menubar.go
new file mode 100644
index 0000000..345c8e5
--- /dev/null
+++ b/internal/menubar/menubar.go
@@ -0,0 +1,99 @@
+// Package menubar turns the toolkit-independent menu bar of package app
+// (app.MenuNode) into a Wails application menu. Only macOS uses it; the code
+// builds on every OS so it is compiled and tested everywhere.
+package menubar
+
+import (
+ "sync"
+
+ "github.com/wailsapp/wails/v3/pkg/application"
+
+ "github.com/LowBloat/LowQuery/internal/app"
+)
+
+// roles maps the standard items to Wails roles, which macOS implements
+// through the responder chain (copy:, hide:, terminate:, ...).
+var roles = map[app.MenuRole]application.Role{
+ app.RoleServices: application.ServicesMenu,
+ app.RoleHide: application.Hide,
+ app.RoleHideOthers: application.HideOthers,
+ app.RoleShowAll: application.ShowAll,
+ app.RoleQuit: application.Quit,
+ app.RoleUndo: application.Undo,
+ app.RoleRedo: application.Redo,
+ app.RoleCut: application.Cut,
+ app.RoleCopy: application.Copy,
+ app.RolePaste: application.Paste,
+ app.RoleSelectAll: application.SelectAll,
+ app.RoleMinimise: application.Minimise,
+ app.RoleZoom: application.Zoom,
+ app.RoleFullscreen: application.ToggleFullscreen,
+ app.RoleBringAllToFront: application.BringAllToFront,
+}
+
+// Build makes the Wails menu for nodes; choosing an item calls onClick with
+// its id.
+func Build(nodes []app.MenuNode, onClick func(id string)) *application.Menu {
+ menu := application.NewMenu()
+ add(menu, nodes, onClick)
+ return menu
+}
+
+func add(menu *application.Menu, nodes []app.MenuNode, onClick func(id string)) {
+ for _, n := range nodes {
+ switch n.Kind {
+ case app.MenuSeparatorKind:
+ menu.AddSeparator()
+ case app.MenuSubmenuKind:
+ add(menu.AddSubmenu(n.Label), n.Children, onClick)
+ case app.MenuRoleKind:
+ if role, ok := roles[n.Role]; ok {
+ menu.AddRole(role)
+ }
+ case app.MenuItemKind, app.MenuCheckboxKind:
+ var item *application.MenuItem
+ if n.Kind == app.MenuCheckboxKind {
+ item = menu.AddCheckbox(n.Label, n.Checked)
+ } else {
+ item = menu.Add(n.Label)
+ }
+ item.SetEnabled(!n.Disabled)
+ // BuildMenuBar keeps only accelerators Wails parses.
+ if n.Accelerator != "" {
+ item.SetAccelerator(n.Accelerator)
+ }
+ id := n.ID
+ item.OnClick(func(*application.Context) { onClick(id) })
+ }
+ }
+}
+
+// Bar replaces the application menu each time the interface describes it.
+type Bar struct {
+ mu sync.Mutex
+ set func(*application.Menu)
+ onClick func(id string)
+ // The menu on screen and the one before it. The one before is released
+ // on the next change rather than at once, so a click already on its way
+ // from the replaced menu still finds its item.
+ current, previous *application.Menu
+}
+
+// New returns a Bar that installs menus with set (the Wails
+// Menu.SetApplicationMenu) and reports clicks to onClick.
+func New(set func(*application.Menu), onClick func(id string)) *Bar {
+ return &Bar{set: set, onClick: onClick}
+}
+
+// Set replaces the menu bar with nodes.
+func (b *Bar) Set(nodes []app.MenuNode) {
+ b.mu.Lock()
+ defer b.mu.Unlock()
+ menu := Build(nodes, b.onClick)
+ b.set(menu)
+ if old := b.previous; old != nil {
+ // Releasing native items belongs on the main thread.
+ application.InvokeAsync(old.Destroy)
+ }
+ b.previous, b.current = b.current, menu
+}
diff --git a/internal/menubar/menubar_test.go b/internal/menubar/menubar_test.go
new file mode 100644
index 0000000..ec51d05
--- /dev/null
+++ b/internal/menubar/menubar_test.go
@@ -0,0 +1,82 @@
+package menubar
+
+import (
+ "testing"
+
+ "github.com/wailsapp/wails/v3/pkg/application"
+
+ "github.com/LowBloat/LowQuery/internal/app"
+)
+
+// Every standard item BuildMenuBar uses has a Wails role.
+func TestRolesCovered(t *testing.T) {
+ var walk func([]app.MenuNode)
+ walk = func(nodes []app.MenuNode) {
+ for _, n := range nodes {
+ if n.Kind == app.MenuRoleKind {
+ if _, ok := roles[n.Role]; !ok {
+ t.Errorf("no Wails role for %q", n.Role)
+ }
+ }
+ walk(n.Children)
+ }
+ }
+ walk(app.BuildMenuBar("LowQuery", app.MenuBarDescription{About: app.MenuEntryDescription{ID: "about"}}))
+}
+
+// Role items need a running Wails app (their labels use its name), so the
+// build is checked on the app's own menus.
+func TestBuild(t *testing.T) {
+ checked := true
+ bar := app.BuildMenuBar("LowQuery", app.MenuBarDescription{Menus: []app.MenuDescription{
+ {Label: "Query", Entries: []app.MenuEntryDescription{
+ {ID: "q/run", Label: "Run statement", Accelerator: "CmdOrCtrl+Enter"},
+ {ID: "q/stop", Label: "Stop", Disabled: true},
+ {Separator: true},
+ {ID: "q/auto", Label: "Auto-commit", Checked: &checked},
+ }},
+ }})
+ var own []app.MenuNode
+ for _, n := range bar {
+ if n.Label == "Query" {
+ own = append(own, n)
+ }
+ }
+ menu := Build(own, func(string) {})
+
+ query := menu.ItemAt(0)
+ if query == nil || !query.IsSubmenu() || query.Label() != "Query" {
+ t.Fatalf("first item %+v", query)
+ }
+ sub := query.GetSubmenu()
+ run, stop, sep, auto := sub.ItemAt(0), sub.ItemAt(1), sub.ItemAt(2), sub.ItemAt(3)
+ if run.Label() != "Run statement" || !run.Enabled() || run.IsCheckbox() || run.GetAccelerator() == "" {
+ t.Errorf("run: %q enabled=%v accelerator=%q", run.Label(), run.Enabled(), run.GetAccelerator())
+ }
+ if stop.Enabled() || stop.GetAccelerator() != "" {
+ t.Errorf("stop: enabled=%v", stop.Enabled())
+ }
+ if !sep.IsSeparator() {
+ t.Error("third item is not a separator")
+ }
+ if !auto.IsCheckbox() || !auto.Checked() || !auto.Enabled() {
+ t.Errorf("auto-commit: checkbox=%v checked=%v", auto.IsCheckbox(), auto.Checked())
+ }
+ if sub.ItemAt(4) != nil {
+ t.Error("extra items")
+ }
+}
+
+func TestBarKeepsOnePreviousMenu(t *testing.T) {
+ var installed []*application.Menu
+ b := New(func(m *application.Menu) { installed = append(installed, m) }, func(string) {})
+ nodes := []app.MenuNode{{Kind: app.MenuSubmenuKind, Label: "File", Children: []app.MenuNode{{Kind: app.MenuItemKind, ID: "x", Label: "X"}}}}
+ b.Set(nodes)
+ b.Set(nodes)
+ if len(installed) != 2 || installed[0] == installed[1] {
+ t.Fatalf("installed %d menus", len(installed))
+ }
+ if b.current != installed[1] || b.previous != installed[0] {
+ t.Error("current and previous menus not kept")
+ }
+}
diff --git a/internal/updater/download.go b/internal/updater/download.go
new file mode 100644
index 0000000..55b990f
--- /dev/null
+++ b/internal/updater/download.go
@@ -0,0 +1,203 @@
+package updater
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "net/url"
+ "os"
+ "path"
+ "path/filepath"
+ "strings"
+ "sync"
+ "time"
+)
+
+// Package is a downloaded update whose signature has been verified.
+type Package struct {
+ Version string
+ Notes string
+ // Target is the manifest key it was downloaded for.
+ Target string
+ // Path is the downloaded file, named like the release asset.
+ Path string
+ Signature string
+}
+
+// Progress reports a running download. Total is 0 when the size is unknown.
+type Progress struct {
+ Received int64
+ Total int64
+}
+
+// DownloadOptions are the inputs of Download.
+type DownloadOptions struct {
+ Client *http.Client
+ Manifest *Manifest
+ // Target is the manifest key; empty picks DefaultTargets.
+ Target string
+ // Dir receives the package; it is created when missing.
+ Dir string
+ // PublicKey verifies the package; empty means PublicKey.
+ PublicKey string
+ // StallTimeout aborts a download that receives nothing for this long.
+ StallTimeout time.Duration
+ OnProgress func(Progress)
+}
+
+// ErrStalled reports a download that stopped receiving data.
+var ErrStalled = errors.New("the download stalled")
+
+// Download fetches the package for opts.Target from the manifest into
+// opts.Dir and verifies its signature. A package that fails verification is
+// deleted. Cancel ctx to stop it.
+func Download(ctx context.Context, opts DownloadOptions) (*Package, error) {
+ m := opts.Manifest
+ target, platform, err := m.Select(opts.Target)
+ if err != nil {
+ return nil, err
+ }
+ name, err := assetName(platform.URL)
+ if err != nil {
+ return nil, err
+ }
+ if err := os.MkdirAll(opts.Dir, 0o755); err != nil {
+ return nil, err
+ }
+ key := opts.PublicKey
+ if key == "" {
+ key = PublicKey
+ }
+ dest := filepath.Join(opts.Dir, name)
+ pkg := &Package{Version: m.Version, Notes: m.Notes, Target: target, Path: dest, Signature: platform.Signature}
+
+ // Downloaded before (an earlier prefetch): keep it if it still verifies.
+ if _, err := os.Stat(dest); err == nil {
+ if VerifyFile(dest, platform.Signature, key, m.Version) == nil {
+ return pkg, nil
+ }
+ _ = os.Remove(dest)
+ }
+
+ part := dest + ".part"
+ if err := fetch(ctx, opts, platform.URL, part); err != nil {
+ _ = os.Remove(part)
+ return nil, err
+ }
+ if err := VerifyFile(part, platform.Signature, key, m.Version); err != nil {
+ _ = os.Remove(part)
+ return nil, err
+ }
+ if err := os.Rename(part, dest); err != nil {
+ _ = os.Remove(part)
+ return nil, err
+ }
+ return pkg, nil
+}
+
+// assetName is the file name of the release asset at rawURL.
+func assetName(rawURL string) (string, error) {
+ u, err := url.Parse(rawURL)
+ if err != nil || (u.Scheme != "https" && u.Scheme != "http") {
+ return "", fmt.Errorf("invalid update URL %q", rawURL)
+ }
+ name := path.Base(u.Path)
+ if name == "" || name == "." || name == "/" || name == ".." || strings.ContainsAny(name, `\:*?"<>|`) {
+ return "", fmt.Errorf("invalid update URL %q", rawURL)
+ }
+ return name, nil
+}
+
+func fetch(ctx context.Context, opts DownloadOptions, rawURL, dest string) error {
+ ctx, cancel := context.WithCancelCause(ctx)
+ defer cancel(nil)
+ client := opts.Client
+ if client == nil {
+ client = http.DefaultClient
+ }
+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, rawURL, nil)
+ if err != nil {
+ return err
+ }
+ req.Header.Set("Accept", "application/octet-stream")
+
+ // The stall timer runs from the request on and restarts with every read.
+ var watchdog *time.Timer
+ if opts.StallTimeout > 0 {
+ watchdog = time.AfterFunc(opts.StallTimeout, func() { cancel(ErrStalled) })
+ defer watchdog.Stop()
+ }
+ fail := func(err error) error {
+ if cause := context.Cause(ctx); cause != nil && ctx.Err() != nil {
+ return cause
+ }
+ return err
+ }
+
+ resp, err := client.Do(req)
+ if err != nil {
+ return fail(err)
+ }
+ defer resp.Body.Close()
+ if resp.StatusCode != http.StatusOK {
+ return fmt.Errorf("download failed: %s", resp.Status)
+ }
+ total := resp.ContentLength
+ if total < 0 {
+ total = 0
+ }
+ f, err := os.OpenFile(dest, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0o644)
+ if err != nil {
+ return err
+ }
+ defer f.Close()
+
+ report := throttle(opts.OnProgress, 100*time.Millisecond)
+ report(Progress{Total: total}, true)
+ var received int64
+ buf := make([]byte, 64<<10)
+ for {
+ n, rerr := resp.Body.Read(buf)
+ if n > 0 {
+ if watchdog != nil {
+ watchdog.Reset(opts.StallTimeout)
+ }
+ if _, err := f.Write(buf[:n]); err != nil {
+ return err
+ }
+ received += int64(n)
+ report(Progress{Received: received, Total: total}, false)
+ }
+ if rerr == io.EOF {
+ break
+ }
+ if rerr != nil {
+ return fail(rerr)
+ }
+ }
+ if total > 0 && received != total {
+ return fmt.Errorf("download incomplete: %d of %d bytes", received, total)
+ }
+ report(Progress{Received: received, Total: total}, true)
+ return f.Close()
+}
+
+// throttle limits progress reports to one per interval, plus forced ones.
+func throttle(f func(Progress), every time.Duration) func(Progress, bool) {
+ if f == nil {
+ return func(Progress, bool) {}
+ }
+ var mu sync.Mutex
+ var last time.Time
+ return func(p Progress, force bool) {
+ mu.Lock()
+ defer mu.Unlock()
+ if !force && time.Since(last) < every {
+ return
+ }
+ last = time.Now()
+ f(p)
+ }
+}
diff --git a/internal/updater/download_test.go b/internal/updater/download_test.go
new file mode 100644
index 0000000..7972499
--- /dev/null
+++ b/internal/updater/download_test.go
@@ -0,0 +1,194 @@
+package updater
+
+import (
+ "context"
+ "crypto/rand"
+ "encoding/json"
+ "errors"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "strconv"
+ "sync"
+ "testing"
+ "time"
+)
+
+// releaseServer serves latest.json and one package signed with the
+// throwaway key, the way GitHub Releases does (the asset behind a redirect).
+type releaseServer struct {
+ *httptest.Server
+ asset []byte
+ sig string
+ tamper bool
+ stall chan struct{}
+ requests int
+ mu sync.Mutex
+}
+
+func newReleaseServer(t *testing.T, version string) *releaseServer {
+ t.Helper()
+ asset := make([]byte, 300<<10)
+ _, _ = rand.Read(asset)
+ asset[0], asset[1] = 'M', 'Z'
+ file := filepath.Join(t.TempDir(), "LowQuery-"+version+"-windows-x64-setup.exe")
+ if err := os.WriteFile(file, asset, 0o644); err != nil {
+ t.Fatal(err)
+ }
+ sig, err := SignFile(throwawayKey(t), file, version, time.Now())
+ if err != nil {
+ t.Fatal(err)
+ }
+ rs := &releaseServer{asset: asset, sig: sig}
+ mux := http.NewServeMux()
+ mux.HandleFunc("/latest.json", func(w http.ResponseWriter, r *http.Request) {
+ base := "http://" + r.Host
+ p := Platform{URL: base + "/download/" + filepath.Base(file), Signature: rs.sig}
+ _ = json.NewEncoder(w).Encode(Manifest{Version: version, Notes: "notes", Platforms: map[string]Platform{
+ "windows-x86_64": p, "windows-x86_64-nsis": p, "linux-x86_64-deb": p,
+ }})
+ })
+ mux.HandleFunc("/download/", func(w http.ResponseWriter, r *http.Request) {
+ http.Redirect(w, r, "/assets/"+filepath.Base(r.URL.Path), http.StatusFound)
+ })
+ mux.HandleFunc("/assets/", func(w http.ResponseWriter, r *http.Request) {
+ rs.mu.Lock()
+ rs.requests++
+ rs.mu.Unlock()
+ body := append([]byte(nil), rs.asset...)
+ if rs.tamper {
+ body[len(body)/2] ^= 0xff
+ }
+ w.Header().Set("Content-Length", strconv.Itoa(len(body)))
+ if rs.stall != nil {
+ _, _ = w.Write(body[:1000])
+ w.(http.Flusher).Flush()
+ select {
+ case <-rs.stall:
+ case <-r.Context().Done():
+ }
+ return
+ }
+ _, _ = w.Write(body)
+ })
+ rs.Server = httptest.NewServer(mux)
+ t.Cleanup(rs.Close)
+ return rs
+}
+
+func (rs *releaseServer) manifest(t *testing.T) *Manifest {
+ t.Helper()
+ m, err := FetchManifest(context.Background(), rs.Client(), rs.URL+"/latest.json")
+ if err != nil {
+ t.Fatal(err)
+ }
+ return m
+}
+
+func TestDownloadEndToEnd(t *testing.T) {
+ rs := newReleaseServer(t, "2.0.0")
+ dir := t.TempDir()
+ var progress []Progress
+ opts := DownloadOptions{
+ Client: rs.Client(),
+ Manifest: rs.manifest(t),
+ Target: "linux-x86_64-deb",
+ Dir: dir,
+ PublicKey: readTestdata(t, "throwaway.key.pub"),
+ OnProgress: func(p Progress) { progress = append(progress, p) },
+ }
+ pkg, err := Download(context.Background(), opts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if pkg.Version != "2.0.0" || pkg.Notes != "notes" || pkg.Target != "linux-x86_64-deb" ||
+ pkg.Path != filepath.Join(dir, "LowQuery-2.0.0-windows-x64-setup.exe") {
+ t.Fatalf("%+v", pkg)
+ }
+ got, _ := os.ReadFile(pkg.Path)
+ if len(got) != len(rs.asset) {
+ t.Fatalf("size %d", len(got))
+ }
+ last := progress[len(progress)-1]
+ if len(progress) < 2 || last.Received != int64(len(rs.asset)) || last.Total != int64(len(rs.asset)) {
+ t.Fatalf("progress %+v", progress)
+ }
+ if _, err := os.Stat(pkg.Path + ".part"); err == nil {
+ t.Fatal(".part left behind")
+ }
+ // What Install checks first.
+ if err := VerifyFile(pkg.Path, pkg.Signature, opts.PublicKey, pkg.Version); err != nil {
+ t.Fatal(err)
+ }
+
+ // Downloaded already: kept without a request.
+ before := rs.requests
+ if _, err := Download(context.Background(), opts); err != nil || rs.requests != before {
+ t.Fatalf("second download: %v, %d requests", err, rs.requests-before)
+ }
+}
+
+func TestDownloadRejectsTamperedPackage(t *testing.T) {
+ rs := newReleaseServer(t, "2.0.0")
+ rs.tamper = true
+ dir := t.TempDir()
+ _, err := Download(context.Background(), DownloadOptions{
+ Client: rs.Client(), Manifest: rs.manifest(t), Target: "windows-x86_64", Dir: dir,
+ PublicKey: readTestdata(t, "throwaway.key.pub"),
+ })
+ if !errors.Is(err, ErrBadSignature) {
+ t.Fatalf("got %v", err)
+ }
+ if entries, _ := os.ReadDir(dir); len(entries) != 0 {
+ t.Fatalf("left behind: %v", entries)
+ }
+}
+
+func TestDownloadRejectsOtherKey(t *testing.T) {
+ rs := newReleaseServer(t, "2.0.0")
+ _, err := Download(context.Background(), DownloadOptions{
+ Client: rs.Client(), Manifest: rs.manifest(t), Target: "windows-x86_64", Dir: t.TempDir(),
+ // The key every release is checked with by default.
+ PublicKey: PublicKey,
+ })
+ if !errors.Is(err, ErrBadSignature) {
+ t.Fatalf("got %v", err)
+ }
+}
+
+func TestDownloadRejectsOtherVersion(t *testing.T) {
+ rs := newReleaseServer(t, "2.0.0")
+ m := rs.manifest(t)
+ m.Version = "3.0.0" // a manifest pairing a new number with an old package
+ _, err := Download(context.Background(), DownloadOptions{
+ Client: rs.Client(), Manifest: m, Target: "windows-x86_64", Dir: t.TempDir(),
+ PublicKey: readTestdata(t, "throwaway.key.pub"),
+ })
+ if err == nil {
+ t.Fatal("accepted")
+ }
+}
+
+func TestDownloadStallAndCancel(t *testing.T) {
+ rs := newReleaseServer(t, "2.0.0")
+ rs.stall = make(chan struct{})
+ defer close(rs.stall)
+ opts := DownloadOptions{
+ Client: rs.Client(), Manifest: rs.manifest(t), Target: "windows-x86_64", Dir: t.TempDir(),
+ PublicKey: readTestdata(t, "throwaway.key.pub"), StallTimeout: 300 * time.Millisecond,
+ }
+ if _, err := Download(context.Background(), opts); !errors.Is(err, ErrStalled) {
+ t.Fatalf("stall: %v", err)
+ }
+
+ opts.StallTimeout = 0
+ ctx, cancel := context.WithCancel(context.Background())
+ time.AfterFunc(300*time.Millisecond, cancel)
+ if _, err := Download(ctx, opts); !errors.Is(err, context.Canceled) {
+ t.Fatalf("cancel: %v", err)
+ }
+ if entries, _ := os.ReadDir(opts.Dir); len(entries) != 0 {
+ t.Fatalf("left behind: %v", entries)
+ }
+}
diff --git a/internal/updater/install.go b/internal/updater/install.go
new file mode 100644
index 0000000..1833921
--- /dev/null
+++ b/internal/updater/install.go
@@ -0,0 +1,212 @@
+package updater
+
+import (
+ "archive/tar"
+ "bytes"
+ "compress/gzip"
+ "errors"
+ "fmt"
+ "io"
+ "os"
+ "path"
+ "path/filepath"
+ "strings"
+)
+
+// ErrCannotInstall reports a copy that has no way to install updates.
+var ErrCannotInstall = errors.New("this copy of LowQuery cannot install updates: download the new version instead")
+
+// Install installs pkg over the copy policy describes. The signature is
+// checked again first, so a file changed since the download is never run.
+// On Windows it starts the setup, which waits for the app to close: quit
+// right after. Elsewhere the new version is in place on return: call
+// Relaunch, then quit.
+func Install(pkg *Package, policy Policy, publicKey string) error {
+ if pkg == nil {
+ return errors.New("no update has been downloaded")
+ }
+ if !policy.CanInstall {
+ return ErrCannotInstall
+ }
+ if publicKey == "" {
+ publicKey = PublicKey
+ }
+ if err := VerifyFile(pkg.Path, pkg.Signature, publicKey, pkg.Version); err != nil {
+ return err
+ }
+ if err := checkFormat(policy.Channel, pkg.Path); err != nil {
+ return err
+ }
+ return install(pkg, policy)
+}
+
+// Relaunch starts the updated copy. The Windows setup restarts the app
+// itself, so there it does nothing.
+func Relaunch(policy Policy) error { return relaunch(policy) }
+
+// Magic numbers of the packages each channel installs.
+var formats = map[string]struct {
+ magic []byte
+ name string
+}{
+ "windows": {[]byte("MZ"), "a Windows setup program"},
+ "darwin": {[]byte{0x1f, 0x8b}, "a .app.tar.gz archive"},
+ "appimage": {[]byte("\x7fELF"), "an AppImage"},
+ "deb": {[]byte("!\n"), "a .deb package"},
+ "rpm": {[]byte{0xed, 0xab, 0xee, 0xdb}, "an .rpm package"},
+}
+
+// checkFormat makes sure the package is what the channel installs.
+func checkFormat(channel, file string) error {
+ key := channel
+ if channel == "installer" {
+ key = installerFormat
+ }
+ f, ok := formats[key]
+ if !ok {
+ return ErrCannotInstall
+ }
+ head := make([]byte, len(f.magic))
+ fh, err := os.Open(file)
+ if err != nil {
+ return err
+ }
+ defer fh.Close()
+ if _, err := io.ReadFull(fh, head); err != nil || !bytes.Equal(head, f.magic) {
+ return fmt.Errorf("the update is not %s", f.name)
+ }
+ return nil
+}
+
+// replaceFile puts the content of src at target, keeping target's mode. The
+// new file is written next to target and renamed over it, so target is
+// never half written (a running AppImage keeps its open inode).
+func replaceFile(target, src string) error {
+ info, err := os.Stat(target)
+ if err != nil {
+ return err
+ }
+ in, err := os.Open(src)
+ if err != nil {
+ return err
+ }
+ defer in.Close()
+ tmp, err := os.CreateTemp(filepath.Dir(target), ".lowquery-update-*")
+ if err != nil {
+ return err
+ }
+ defer os.Remove(tmp.Name())
+ if _, err := io.Copy(tmp, in); err != nil {
+ tmp.Close()
+ return err
+ }
+ if err := tmp.Close(); err != nil {
+ return err
+ }
+ if err := os.Chmod(tmp.Name(), info.Mode().Perm()); err != nil {
+ return err
+ }
+ return os.Rename(tmp.Name(), target)
+}
+
+// extractAppBundle unpacks a .app.tar.gz (LowQuery.app/...) into dest,
+// dropping the first path component as the Tauri updater does, so dest
+// becomes the bundle.
+func extractAppBundle(archive, dest string) error {
+ f, err := os.Open(archive)
+ if err != nil {
+ return err
+ }
+ defer f.Close()
+ gz, err := gzip.NewReader(f)
+ if err != nil {
+ return err
+ }
+ defer gz.Close()
+ if err := os.MkdirAll(dest, 0o755); err != nil {
+ return err
+ }
+ tr := tar.NewReader(gz)
+ files := 0
+ for {
+ h, err := tr.Next()
+ if err == io.EOF {
+ break
+ }
+ if err != nil {
+ return err
+ }
+ rel, ok := bundlePath(h.Name)
+ if !ok {
+ return fmt.Errorf("unsafe path in update archive: %q", h.Name)
+ }
+ if rel == "" {
+ continue
+ }
+ out := filepath.Join(dest, filepath.FromSlash(rel))
+ mode := os.FileMode(h.Mode).Perm()
+ switch h.Typeflag {
+ case tar.TypeDir:
+ if err := os.MkdirAll(out, mode|0o700); err != nil {
+ return err
+ }
+ case tar.TypeReg:
+ if err := os.MkdirAll(filepath.Dir(out), 0o755); err != nil {
+ return err
+ }
+ w, err := os.OpenFile(out, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, mode|0o600)
+ if err != nil {
+ return err
+ }
+ _, err = io.Copy(w, tr)
+ if cerr := w.Close(); err == nil {
+ err = cerr
+ }
+ if err != nil {
+ return err
+ }
+ files++
+ case tar.TypeSymlink:
+ // Frameworks link Versions/Current and the like; the link must
+ // stay inside the bundle.
+ if path.IsAbs(h.Linkname) {
+ return fmt.Errorf("unsafe link in update archive: %q", h.Name)
+ }
+ if _, ok := bundlePath("x/" + path.Join(path.Dir(rel), h.Linkname)); !ok {
+ return fmt.Errorf("unsafe link in update archive: %q", h.Name)
+ }
+ if err := os.MkdirAll(filepath.Dir(out), 0o755); err != nil {
+ return err
+ }
+ if err := os.Symlink(h.Linkname, out); err != nil {
+ return err
+ }
+ default:
+ return fmt.Errorf("unsupported entry in update archive: %q", h.Name)
+ }
+ }
+ if files == 0 {
+ return errors.New("the update archive is empty")
+ }
+ return nil
+}
+
+// bundlePath is name without its first component; false when it would
+// leave the bundle.
+func bundlePath(name string) (string, bool) {
+ name = strings.TrimPrefix(name, "./")
+ if path.IsAbs(name) || strings.Contains(name, `\`) {
+ return "", false
+ }
+ _, rest, _ := strings.Cut(name, "/")
+ clean := path.Clean("/" + rest)
+ if clean == "/" {
+ return "", true
+ }
+ for _, part := range strings.Split(rest, "/") {
+ if part == ".." {
+ return "", false
+ }
+ }
+ return strings.TrimPrefix(clean, "/"), true
+}
diff --git a/internal/updater/install_darwin.go b/internal/updater/install_darwin.go
new file mode 100644
index 0000000..4b58593
--- /dev/null
+++ b/internal/updater/install_darwin.go
@@ -0,0 +1,58 @@
+package updater
+
+import (
+ "errors"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "time"
+
+ "golang.org/x/sys/unix"
+)
+
+const installerFormat = "darwin"
+
+// install unpacks the .app.tar.gz next to the bundle (same volume, so the
+// renames work) and swaps it with the bundle in one step where the file
+// system can (APFS), or moves the old one aside and restores it on failure.
+func install(pkg *Package, policy Policy) error {
+ if policy.Channel != "installer" || policy.Path == "" {
+ return ErrCannotInstall
+ }
+ bundle := policy.Path
+ staging, err := os.MkdirTemp(filepath.Dir(bundle), ".lowquery-update-")
+ if err != nil {
+ return err
+ }
+ defer os.RemoveAll(staging)
+ staged := filepath.Join(staging, "new.app")
+ if err := extractAppBundle(pkg.Path, staged); err != nil {
+ return err
+ }
+ if err := os.Chmod(staged, 0o755); err != nil {
+ return err
+ }
+ // After a swap, staged holds the old bundle and goes with staging.
+ if err := unix.RenamexNp(staged, bundle, unix.RENAME_SWAP); err != nil {
+ if errors.Is(err, unix.EACCES) || errors.Is(err, unix.EPERM) {
+ return err
+ }
+ old := filepath.Join(staging, "old.app")
+ if err := os.Rename(bundle, old); err != nil {
+ return err
+ }
+ if err := os.Rename(staged, bundle); err != nil {
+ _ = os.Rename(old, bundle)
+ return err
+ }
+ }
+ // Tells Launch Services and the Dock the bundle changed.
+ now := time.Now()
+ _ = os.Chtimes(bundle, now, now)
+ return nil
+}
+
+// relaunch opens a new instance of the bundle; the caller then quits.
+func relaunch(policy Policy) error {
+ return exec.Command("/usr/bin/open", "-n", policy.Path).Start()
+}
diff --git a/internal/updater/install_linux.go b/internal/updater/install_linux.go
new file mode 100644
index 0000000..d2ac3e7
--- /dev/null
+++ b/internal/updater/install_linux.go
@@ -0,0 +1,48 @@
+package updater
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "syscall"
+)
+
+const installerFormat = ""
+
+// install replaces a writable AppImage, or hands a .deb/.rpm to dpkg/rpm
+// through pkexec, which asks for the administrator password.
+func install(pkg *Package, policy Policy) error {
+ switch policy.Channel {
+ case "appimage":
+ return replaceFile(policy.Path, pkg.Path)
+ case "deb":
+ return pkexec("dpkg", "-i", pkg.Path)
+ case "rpm":
+ return pkexec("rpm", "-U", pkg.Path)
+ }
+ return ErrCannotInstall
+}
+
+func pkexec(program, flag, file string) error {
+ cmd := exec.Command("pkexec", program, flag, file)
+ out, err := cmd.CombinedOutput()
+ if err != nil {
+ if exit, ok := err.(*exec.ExitError); ok && (exit.ExitCode() == 126 || exit.ExitCode() == 127) {
+ return fmt.Errorf("the update needs the administrator password, which was not given")
+ }
+ return fmt.Errorf("%s could not install the update: %v\n%s", program, err, out)
+ }
+ return nil
+}
+
+// relaunch starts the updated AppImage or executable in its own session;
+// the caller then quits.
+func relaunch(policy Policy) error {
+ cmd := exec.Command(policy.Path)
+ cmd.Env = os.Environ()
+ cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
+ if err := cmd.Start(); err != nil {
+ return err
+ }
+ return cmd.Process.Release()
+}
diff --git a/internal/updater/install_other.go b/internal/updater/install_other.go
new file mode 100644
index 0000000..0487a2a
--- /dev/null
+++ b/internal/updater/install_other.go
@@ -0,0 +1,9 @@
+//go:build !windows && !darwin && !linux
+
+package updater
+
+const installerFormat = ""
+
+func install(*Package, Policy) error { return ErrCannotInstall }
+
+func relaunch(Policy) error { return ErrCannotInstall }
diff --git a/internal/updater/install_test.go b/internal/updater/install_test.go
new file mode 100644
index 0000000..6b1c631
--- /dev/null
+++ b/internal/updater/install_test.go
@@ -0,0 +1,185 @@
+package updater
+
+import (
+ "archive/tar"
+ "bytes"
+ "compress/gzip"
+ "errors"
+ "os"
+ "path/filepath"
+ "runtime"
+ "testing"
+)
+
+type tarEntry struct {
+ name, body, link string
+ dir bool
+}
+
+func writeTarGz(t *testing.T, path string, entries []tarEntry) {
+ t.Helper()
+ var buf bytes.Buffer
+ gz := gzip.NewWriter(&buf)
+ tw := tar.NewWriter(gz)
+ for _, e := range entries {
+ h := &tar.Header{Name: e.name, Mode: 0o755}
+ switch {
+ case e.dir:
+ h.Typeflag = tar.TypeDir
+ case e.link != "":
+ h.Typeflag, h.Linkname = tar.TypeSymlink, e.link
+ default:
+ h.Typeflag, h.Size, h.Mode = tar.TypeReg, int64(len(e.body)), 0o644
+ }
+ if err := tw.WriteHeader(h); err != nil {
+ t.Fatal(err)
+ }
+ if h.Typeflag == tar.TypeReg {
+ _, _ = tw.Write([]byte(e.body))
+ }
+ }
+ tw.Close()
+ gz.Close()
+ if err := os.WriteFile(path, buf.Bytes(), 0o644); err != nil {
+ t.Fatal(err)
+ }
+}
+
+func TestExtractAppBundle(t *testing.T) {
+ dir := t.TempDir()
+ archive := filepath.Join(dir, "LowQuery.app.tar.gz")
+ entries := []tarEntry{
+ {name: "LowQuery.app/", dir: true},
+ {name: "LowQuery.app/Contents/", dir: true},
+ {name: "LowQuery.app/Contents/Info.plist", body: ""},
+ {name: "LowQuery.app/Contents/MacOS/LowQuery", body: "binary"},
+ }
+ if runtime.GOOS != "windows" {
+ entries = append(entries,
+ tarEntry{name: "LowQuery.app/Contents/Frameworks/X.framework/Versions/A/X", body: "lib"},
+ tarEntry{name: "LowQuery.app/Contents/Frameworks/X.framework/Versions/Current", link: "A"})
+ }
+ writeTarGz(t, archive, entries)
+ dest := filepath.Join(dir, "new.app")
+ if err := extractAppBundle(archive, dest); err != nil {
+ t.Fatal(err)
+ }
+ b, err := os.ReadFile(filepath.Join(dest, "Contents", "MacOS", "LowQuery"))
+ if err != nil || string(b) != "binary" {
+ t.Fatalf("%q %v", b, err)
+ }
+ if runtime.GOOS != "windows" {
+ b, err := os.ReadFile(filepath.Join(dest, "Contents", "Frameworks", "X.framework", "Versions", "Current", "X"))
+ if err != nil || string(b) != "lib" {
+ t.Fatalf("symlink: %q %v", b, err)
+ }
+ }
+}
+
+func TestExtractAppBundleRejectsEscapes(t *testing.T) {
+ cases := [][]tarEntry{
+ {{name: "LowQuery.app/../../evil", body: "x"}},
+ {{name: "/etc/evil", body: "x"}},
+ {{name: "LowQuery.app/Contents/link", link: "../../../etc"}},
+ {{name: "LowQuery.app/Contents/link", link: "/etc"}},
+ {{name: "LowQuery.app/", dir: true}},
+ }
+ for i, entries := range cases {
+ dir := t.TempDir()
+ archive := filepath.Join(dir, "a.tar.gz")
+ writeTarGz(t, archive, entries)
+ if err := extractAppBundle(archive, filepath.Join(dir, "out")); err == nil {
+ t.Errorf("case %d extracted", i)
+ }
+ if _, err := os.Stat(filepath.Join(dir, "evil")); err == nil {
+ t.Errorf("case %d escaped", i)
+ }
+ }
+}
+
+func TestReplaceFile(t *testing.T) {
+ dir := t.TempDir()
+ current := filepath.Join(dir, "LowQuery.AppImage")
+ next := filepath.Join(t.TempDir(), "new.AppImage")
+ if err := os.WriteFile(current, []byte("old"), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(next, []byte("\x7fELFnew"), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ if err := replaceFile(current, next); err != nil {
+ t.Fatal(err)
+ }
+ b, _ := os.ReadFile(current)
+ if string(b) != "\x7fELFnew" {
+ t.Fatalf("content %q", b)
+ }
+ if runtime.GOOS != "windows" {
+ if info, _ := os.Stat(current); info.Mode().Perm() != 0o755 {
+ t.Fatalf("mode %v", info.Mode())
+ }
+ }
+ if entries, _ := os.ReadDir(dir); len(entries) != 1 {
+ t.Fatalf("left behind: %v", entries)
+ }
+}
+
+func TestCheckFormat(t *testing.T) {
+ dir := t.TempDir()
+ write := func(name, content string) string {
+ p := filepath.Join(dir, name)
+ if err := os.WriteFile(p, []byte(content), 0o644); err != nil {
+ t.Fatal(err)
+ }
+ return p
+ }
+ ok := map[string]string{
+ "appimage": write("a.AppImage", "\x7fELF\x02\x01"),
+ "deb": write("a.deb", "!\ndebian-binary"),
+ "rpm": write("a.rpm", "\xed\xab\xee\xdb\x03\x00"),
+ }
+ for channel, file := range ok {
+ if err := checkFormat(channel, file); err != nil {
+ t.Errorf("%s: %v", channel, err)
+ }
+ }
+ bad := write("bad", "")
+ for _, channel := range []string{"appimage", "deb", "rpm"} {
+ if err := checkFormat(channel, bad); err == nil {
+ t.Errorf("%s accepted html", channel)
+ }
+ }
+ if !errors.Is(checkFormat("portable", bad), ErrCannotInstall) {
+ t.Error("portable channel accepted")
+ }
+ switch runtime.GOOS {
+ case "windows":
+ if checkFormat("installer", write("s.exe", "MZ\x90")) != nil || checkFormat("installer", bad) == nil {
+ t.Error("windows setup check")
+ }
+ case "darwin":
+ if checkFormat("installer", write("a.tar.gz", "\x1f\x8b\x08")) != nil || checkFormat("installer", bad) == nil {
+ t.Error("mac archive check")
+ }
+ }
+}
+
+// Install checks the signature before anything else, so a package changed
+// after its download is never run. (A valid package is never installed
+// here: that would run the setup.)
+func TestInstallRejectsTamperedPackage(t *testing.T) {
+ data := []byte(readTestdata(t, "payload.bin"))
+ data[0] ^= 1
+ path := filepath.Join(t.TempDir(), "payload.bin")
+ if err := os.WriteFile(path, data, 0o644); err != nil {
+ t.Fatal(err)
+ }
+ pkg := &Package{Version: "1.2.3", Path: path, Signature: readTestdata(t, "payload.bin.sig")}
+ policy := Policy{Channel: "installer", CanInstall: true, Path: t.TempDir()}
+ if err := Install(pkg, policy, readTestdata(t, "throwaway.key.pub")); !errors.Is(err, ErrBadSignature) {
+ t.Fatalf("got %v", err)
+ }
+ if err := Install(pkg, Policy{Channel: "portable"}, readTestdata(t, "throwaway.key.pub")); !errors.Is(err, ErrCannotInstall) {
+ t.Fatalf("portable: %v", err)
+ }
+}
diff --git a/internal/updater/install_windows.go b/internal/updater/install_windows.go
new file mode 100644
index 0000000..ede3e25
--- /dev/null
+++ b/internal/updater/install_windows.go
@@ -0,0 +1,36 @@
+package updater
+
+import (
+ "fmt"
+ "path/filepath"
+
+ "golang.org/x/sys/windows"
+)
+
+const installerFormat = "windows"
+
+// SetupArgs are what the Tauri updater passes the NSIS setup in passive
+// mode: progress only (/P), an update of the existing install (/UPDATE) and
+// a restart of the app when done (/R).
+const SetupArgs = "/P /UPDATE /R"
+
+// install starts the setup through the shell, so a setup that needs
+// elevation gets the UAC prompt. The caller quits so it can replace files.
+func install(pkg *Package, policy Policy) error {
+ if policy.Channel != "installer" {
+ return ErrCannotInstall
+ }
+ verb, _ := windows.UTF16PtrFromString("open")
+ file, err := windows.UTF16PtrFromString(pkg.Path)
+ if err != nil {
+ return err
+ }
+ args, _ := windows.UTF16PtrFromString(SetupArgs)
+ dir, _ := windows.UTF16PtrFromString(filepath.Dir(pkg.Path))
+ if err := windows.ShellExecute(0, verb, file, args, dir, windows.SW_SHOWNORMAL); err != nil {
+ return fmt.Errorf("could not start the setup: %w", err)
+ }
+ return nil
+}
+
+func relaunch(Policy) error { return nil }
diff --git a/internal/updater/manifest.go b/internal/updater/manifest.go
new file mode 100644
index 0000000..cf21bf1
--- /dev/null
+++ b/internal/updater/manifest.go
@@ -0,0 +1,98 @@
+package updater
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "io"
+ "net/http"
+ "runtime"
+ "strings"
+)
+
+// Manifest is latest.json, as .github/scripts/update_manifest.py writes it.
+type Manifest struct {
+ Version string `json:"version"`
+ Notes string `json:"notes"`
+ PubDate string `json:"pub_date"`
+ Platforms map[string]Platform `json:"platforms"`
+}
+
+// Platform is one downloadable package and its signature (base64 of the
+// minisign signature text).
+type Platform struct {
+ URL string `json:"url"`
+ Signature string `json:"signature"`
+}
+
+// manifestLimit bounds the manifest read: it is a few kilobytes.
+const manifestLimit = 4 << 20
+
+// FetchManifest downloads and parses the manifest at url.
+func FetchManifest(ctx context.Context, client *http.Client, url string) (*Manifest, error) {
+ if client == nil {
+ client = http.DefaultClient
+ }
+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
+ if err != nil {
+ return nil, err
+ }
+ req.Header.Set("Accept", "application/json")
+ resp, err := client.Do(req)
+ if err != nil {
+ return nil, err
+ }
+ defer resp.Body.Close()
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("manifest request failed: %s", resp.Status)
+ }
+ var m Manifest
+ if err := json.NewDecoder(io.LimitReader(resp.Body, manifestLimit)).Decode(&m); err != nil {
+ return nil, fmt.Errorf("invalid update manifest: %w", err)
+ }
+ m.Version = strings.TrimPrefix(strings.TrimSpace(m.Version), "v")
+ if m.Version == "" {
+ return nil, fmt.Errorf("invalid update manifest: no version")
+ }
+ return &m, nil
+}
+
+// Select returns the manifest key and package for this copy: the policy's
+// target when it has one, otherwise `{os}-{arch}`, as the Tauri updater does
+// for installs without a bundle-specific key.
+func (m *Manifest) Select(target string) (string, Platform, error) {
+ keys := []string{target}
+ if target == "" {
+ keys = DefaultTargets(runtime.GOOS, runtime.GOARCH)
+ }
+ for _, key := range keys {
+ if p, ok := m.Platforms[key]; ok && p.URL != "" && p.Signature != "" {
+ return key, p, nil
+ }
+ }
+ return "", Platform{}, fmt.Errorf("this release has no update for %s", strings.Join(keys, " or "))
+}
+
+// DefaultTargets are the manifest keys tried when the policy names none.
+func DefaultTargets(goos, goarch string) []string {
+ base := goos + "-" + targetArch(goarch)
+ if goos == "windows" {
+ return []string{base + "-nsis", base}
+ }
+ return []string{base}
+}
+
+// targetArch names goarch the way Rust (and so the manifest) does.
+func targetArch(goarch string) string {
+ switch goarch {
+ case "amd64":
+ return "x86_64"
+ case "arm64":
+ return "aarch64"
+ case "386":
+ return "i686"
+ case "arm":
+ return "armv7"
+ }
+ return goarch
+}
diff --git a/internal/updater/manifest_test.go b/internal/updater/manifest_test.go
new file mode 100644
index 0000000..c3789c0
--- /dev/null
+++ b/internal/updater/manifest_test.go
@@ -0,0 +1,105 @@
+package updater
+
+import (
+ "context"
+ "net/http"
+ "net/http/httptest"
+ "reflect"
+ "runtime"
+ "testing"
+)
+
+// The keys .github/scripts/update_manifest.py writes.
+func releaseManifest() *Manifest {
+ p := func(name string) Platform {
+ return Platform{URL: "https://example.test/" + name, Signature: "sig-" + name}
+ }
+ return &Manifest{Version: "1.0.0", Platforms: map[string]Platform{
+ "windows-x86_64": p("setup.exe"),
+ "windows-x86_64-nsis": p("setup.exe"),
+ "windows-x86_64-msi": p("x64.msi"),
+ "darwin-aarch64": p("macos-universal.app.tar.gz"),
+ "darwin-x86_64": p("macos-universal.app.tar.gz"),
+ "linux-x86_64-appimage": p("linux-x64.AppImage"),
+ "linux-x86_64-deb": p("linux-x64.deb"),
+ "linux-x86_64-rpm": p("linux-x64.rpm"),
+ }}
+}
+
+func TestDefaultTargets(t *testing.T) {
+ cases := []struct {
+ goos, goarch string
+ want []string
+ }{
+ {"windows", "amd64", []string{"windows-x86_64-nsis", "windows-x86_64"}},
+ {"darwin", "arm64", []string{"darwin-aarch64"}},
+ {"darwin", "amd64", []string{"darwin-x86_64"}},
+ {"linux", "amd64", []string{"linux-x86_64"}},
+ }
+ for _, c := range cases {
+ if got := DefaultTargets(c.goos, c.goarch); !reflect.DeepEqual(got, c.want) {
+ t.Errorf("%s/%s: %v, want %v", c.goos, c.goarch, got, c.want)
+ }
+ }
+}
+
+func TestSelect(t *testing.T) {
+ m := releaseManifest()
+ for target, want := range map[string]string{
+ "linux-x86_64-appimage": "linux-x64.AppImage",
+ "linux-x86_64-deb": "linux-x64.deb",
+ "linux-x86_64-rpm": "linux-x64.rpm",
+ "darwin-aarch64": "macos-universal.app.tar.gz",
+ } {
+ key, p, err := m.Select(target)
+ if err != nil || key != target || p.URL != "https://example.test/"+want {
+ t.Errorf("%s: %s %v %v", target, key, p, err)
+ }
+ }
+ if _, _, err := m.Select("linux-aarch64-deb"); err == nil {
+ t.Error("missing target selected")
+ }
+ // No target: the defaults of this machine (none for Linux, whose
+ // installable copies always name a target).
+ key, _, err := m.Select("")
+ switch runtime.GOOS + "/" + runtime.GOARCH {
+ case "windows/amd64":
+ if key != "windows-x86_64-nsis" {
+ t.Errorf("default key %s %v", key, err)
+ }
+ case "darwin/arm64", "darwin/amd64":
+ if err != nil {
+ t.Errorf("default key: %v", err)
+ }
+ case "linux/amd64":
+ if err == nil {
+ t.Errorf("linux default selected %s", key)
+ }
+ }
+ // An entry without a signature is never picked.
+ m.Platforms["linux-x86_64-deb"] = Platform{URL: "https://example.test/x.deb"}
+ if _, _, err := m.Select("linux-x86_64-deb"); err == nil {
+ t.Error("unsigned entry selected")
+ }
+}
+
+func TestFetchManifest(t *testing.T) {
+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ if r.URL.Path == "/missing" {
+ http.NotFound(w, r)
+ return
+ }
+ _, _ = w.Write([]byte(`{"version":"v2.0.1","notes":"n","pub_date":"2026-01-01T00:00:00Z","platforms":{"windows-x86_64":{"url":"https://x/a.exe","signature":"s"}}}`))
+ }))
+ defer srv.Close()
+ m, err := FetchManifest(context.Background(), srv.Client(), srv.URL+"/latest.json")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if m.Version != "2.0.1" || m.Notes != "n" || m.Platforms["windows-x86_64"].URL != "https://x/a.exe" {
+ t.Fatalf("%+v", m)
+ }
+ if _, err := FetchManifest(context.Background(), srv.Client(), srv.URL+"/missing"); err == nil {
+ t.Fatal("404 accepted")
+ }
+}
diff --git a/internal/updater/policy.go b/internal/updater/policy.go
new file mode 100644
index 0000000..b30e4b8
--- /dev/null
+++ b/internal/updater/policy.go
@@ -0,0 +1,175 @@
+package updater
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "runtime"
+ "strings"
+)
+
+// Policy says whether this copy can update itself, as the Tauri builds
+// decided it. Installs from the Windows setup, macOS app bundles in a writable
+// folder, writable AppImages and .deb/.rpm installs download the signed
+// update, install it and restart; others (the Arch package, portable copies)
+// are only told a new version exists.
+type Policy struct {
+ // installer, appimage, deb, rpm, package or portable.
+ Channel string `json:"channel"`
+ CanInstall bool `json:"canInstall"`
+ // Target is the manifest key when the default one does not apply.
+ Target *string `json:"target"`
+
+ // Path is what an install replaces or restarts: the install folder
+ // (Windows), the .app bundle (macOS), the AppImage, or the executable.
+ Path string `json:"-"`
+}
+
+// Env is what Detect looks at; tests replace its functions.
+type Env struct {
+ GOOS string
+ GOARCH string
+ // Exe is the running executable.
+ Exe string
+ Getenv func(string) string
+ // Writable reports whether files can be created in dir.
+ Writable func(dir string) bool
+ // InstallLocations are the folders the Windows setup registered
+ // (HKCU, then HKLM, Uninstall\LowQuery\InstallLocation).
+ InstallLocations func() []string
+ // Owns reports whether the package manager behind program (dpkg-query
+ // -S, rpm -qf) installed path.
+ Owns func(program, flag, path string) bool
+}
+
+// CurrentEnv is the Env of this process.
+func CurrentEnv() Env {
+ exe, err := os.Executable()
+ if err == nil {
+ if resolved, err := filepath.EvalSymlinks(exe); err == nil {
+ exe = resolved
+ }
+ }
+ return Env{
+ GOOS: runtime.GOOS,
+ GOARCH: runtime.GOARCH,
+ Exe: exe,
+ Getenv: os.Getenv,
+ Writable: dirWritable,
+ InstallLocations: registeredInstallLocations,
+ Owns: ownedBy,
+ }
+}
+
+// DetectCurrent is Detect for this process.
+func DetectCurrent() Policy { return Detect(CurrentEnv()) }
+
+// Detect works out the update policy of the copy env describes.
+func Detect(env Env) Policy {
+ portable := Policy{Channel: "portable", Path: env.Exe}
+ if env.Exe == "" {
+ return portable
+ }
+ switch env.GOOS {
+ case "windows":
+ return detectWindows(env)
+ case "darwin":
+ return detectMac(env)
+ case "linux":
+ return detectLinux(env)
+ }
+ return portable
+}
+
+// detectWindows: an install by the setup is the folder it registered under
+// Uninstall\LowQuery, holding the executable and uninstall.exe. That is the
+// Tauri NSIS layout (%LOCALAPPDATA%\LowQuery by default), which the Go setup
+// keeps.
+func detectWindows(env Env) Policy {
+ dir := filepath.Dir(env.Exe)
+ portable := Policy{Channel: "portable", Path: env.Exe}
+ if !fileExists(filepath.Join(dir, "uninstall.exe")) || env.InstallLocations == nil {
+ return portable
+ }
+ for _, loc := range env.InstallLocations() {
+ loc = strings.Trim(strings.TrimSpace(loc), `"`)
+ if loc != "" && strings.EqualFold(filepath.Clean(loc), filepath.Clean(dir)) {
+ return Policy{Channel: "installer", CanInstall: true, Path: dir}
+ }
+ }
+ return portable
+}
+
+// detectMac: the executable must sit in Foo.app/Contents/MacOS, and the
+// folder holding the bundle must be writable to swap it for the new one.
+func detectMac(env Env) Policy {
+ bundle := appBundle(env.Exe)
+ if bundle == "" {
+ return Policy{Channel: "portable", Path: env.Exe}
+ }
+ writable := env.Writable != nil && env.Writable(filepath.Dir(bundle))
+ return Policy{Channel: "installer", CanInstall: writable, Path: bundle}
+}
+
+// appBundle is the .app bundle holding exe, or "".
+func appBundle(exe string) string {
+ macos := filepath.Dir(exe)
+ contents := filepath.Dir(macos)
+ bundle := filepath.Dir(contents)
+ if filepath.Base(macos) != "MacOS" || filepath.Base(contents) != "Contents" ||
+ !strings.HasSuffix(strings.ToLower(bundle), ".app") {
+ return ""
+ }
+ return bundle
+}
+
+func detectLinux(env Env) Policy {
+ arch := targetArch(env.GOARCH)
+ if appimage := env.Getenv("APPIMAGE"); appimage != "" {
+ writable := env.Writable != nil && env.Writable(filepath.Dir(appimage))
+ return Policy{Channel: "appimage", CanInstall: writable, Target: ptr(fmt.Sprintf("linux-%s-appimage", arch)), Path: appimage}
+ }
+ if env.Owns != nil {
+ for _, pm := range []struct{ channel, program, flag string }{
+ {"deb", "dpkg-query", "-S"},
+ {"rpm", "rpm", "-qf"},
+ } {
+ if env.Owns(pm.program, pm.flag, env.Exe) {
+ return Policy{Channel: pm.channel, CanInstall: true, Target: ptr(fmt.Sprintf("linux-%s-%s", arch, pm.channel)), Path: env.Exe}
+ }
+ }
+ }
+ if strings.HasPrefix(env.Exe, "/usr/") || strings.HasPrefix(env.Exe, "/opt/") {
+ return Policy{Channel: "package", Path: env.Exe}
+ }
+ return Policy{Channel: "portable", Path: env.Exe}
+}
+
+func ptr(s string) *string { return &s }
+
+func fileExists(path string) bool {
+ info, err := os.Stat(path)
+ return err == nil && !info.IsDir()
+}
+
+// dirWritable creates and removes a probe file in dir.
+func dirWritable(dir string) bool {
+ probe := filepath.Join(dir, fmt.Sprintf(".lowquery-update-check-%d", os.Getpid()))
+ f, err := os.OpenFile(probe, os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0o600)
+ if err != nil {
+ return false
+ }
+ f.Close()
+ _ = os.Remove(probe)
+ return true
+}
+
+// ownedBy runs `program flag path` (dpkg-query -S, rpm -qf), which succeeds
+// when a package installed path.
+func ownedBy(program, flag, path string) bool {
+ if _, err := exec.LookPath(program); err != nil {
+ return false
+ }
+ return exec.Command(program, flag, path).Run() == nil
+}
diff --git a/internal/updater/policy_test.go b/internal/updater/policy_test.go
new file mode 100644
index 0000000..2a350cd
--- /dev/null
+++ b/internal/updater/policy_test.go
@@ -0,0 +1,135 @@
+package updater
+
+import (
+ "os"
+ "path/filepath"
+ "testing"
+)
+
+func touch(t *testing.T, path string) {
+ t.Helper()
+ if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(path, nil, 0o755); err != nil {
+ t.Fatal(err)
+ }
+}
+
+func target(p Policy) string {
+ if p.Target == nil {
+ return ""
+ }
+ return *p.Target
+}
+
+func TestDetectWindows(t *testing.T) {
+ dir := filepath.Join(t.TempDir(), "LowQuery")
+ exe := filepath.Join(dir, "lowquery.exe")
+ touch(t, exe)
+ env := func(locations ...string) Env {
+ return Env{GOOS: "windows", GOARCH: "amd64", Exe: exe, InstallLocations: func() []string { return locations }}
+ }
+
+ // No uninstall.exe: a copied folder, even if registered.
+ if p := Detect(env(dir)); p.Channel != "portable" || p.CanInstall {
+ t.Fatalf("without uninstall.exe: %+v", p)
+ }
+ touch(t, filepath.Join(dir, "uninstall.exe"))
+ // The setup writes InstallLocation in quotes.
+ for _, loc := range []string{dir, `"` + dir + `"`, dir + string(filepath.Separator)} {
+ p := Detect(env(loc))
+ if p.Channel != "installer" || !p.CanInstall || p.Target != nil || p.Path != dir {
+ t.Fatalf("registered at %s: %+v", loc, p)
+ }
+ }
+ // Registered somewhere else, or not at all.
+ if p := Detect(env(filepath.Join(t.TempDir(), "Other"))); p.Channel != "portable" {
+ t.Fatalf("other location: %+v", p)
+ }
+ if p := Detect(env()); p.Channel != "portable" {
+ t.Fatalf("unregistered: %+v", p)
+ }
+}
+
+func TestDetectMac(t *testing.T) {
+ apps := t.TempDir()
+ exe := filepath.Join(apps, "LowQuery.app", "Contents", "MacOS", "LowQuery")
+ writable := true
+ env := Env{GOOS: "darwin", GOARCH: "arm64", Exe: exe, Writable: func(dir string) bool {
+ if dir != apps {
+ t.Errorf("probed %s, want %s", dir, apps)
+ }
+ return writable
+ }}
+ if p := Detect(env); p.Channel != "installer" || !p.CanInstall || p.Path != filepath.Join(apps, "LowQuery.app") || p.Target != nil {
+ t.Fatalf("writable: %+v", p)
+ }
+ writable = false
+ if p := Detect(env); p.Channel != "installer" || p.CanInstall {
+ t.Fatalf("read-only folder: %+v", p)
+ }
+ env.Exe = filepath.Join(apps, "lowquery")
+ if p := Detect(env); p.Channel != "portable" || p.CanInstall {
+ t.Fatalf("outside a bundle: %+v", p)
+ }
+}
+
+func TestDetectLinux(t *testing.T) {
+ vars := map[string]string{}
+ owner := ""
+ writable := true
+ env := Env{
+ GOOS: "linux", GOARCH: "amd64", Exe: "/usr/bin/lowquery",
+ Getenv: func(k string) string { return vars[k] },
+ Writable: func(string) bool { return writable },
+ Owns: func(program, flag, path string) bool {
+ return program+" "+flag == owner && path == "/usr/bin/lowquery"
+ },
+ }
+
+ vars["APPIMAGE"] = "/home/u/Apps/LowQuery.AppImage"
+ if p := Detect(env); p.Channel != "appimage" || !p.CanInstall || target(p) != "linux-x86_64-appimage" || p.Path != vars["APPIMAGE"] {
+ t.Fatalf("appimage: %+v", p)
+ }
+ writable = false
+ if p := Detect(env); p.Channel != "appimage" || p.CanInstall {
+ t.Fatalf("read-only appimage: %+v", p)
+ }
+ delete(vars, "APPIMAGE")
+
+ owner = "dpkg-query -S"
+ if p := Detect(env); p.Channel != "deb" || !p.CanInstall || target(p) != "linux-x86_64-deb" {
+ t.Fatalf("deb: %+v", p)
+ }
+ owner = "rpm -qf"
+ if p := Detect(env); p.Channel != "rpm" || !p.CanInstall || target(p) != "linux-x86_64-rpm" {
+ t.Fatalf("rpm: %+v", p)
+ }
+ env.GOARCH = "arm64"
+ if p := Detect(env); target(p) != "linux-aarch64-rpm" {
+ t.Fatalf("arm64 rpm: %+v", p)
+ }
+ // Installed by another package manager (pacman).
+ owner = ""
+ if p := Detect(env); p.Channel != "package" || p.CanInstall || p.Target != nil {
+ t.Fatalf("package: %+v", p)
+ }
+ env.Exe = "/home/u/bin/lowquery"
+ if p := Detect(env); p.Channel != "portable" || p.CanInstall {
+ t.Fatalf("portable: %+v", p)
+ }
+}
+
+func TestDirWritable(t *testing.T) {
+ dir := t.TempDir()
+ if !dirWritable(dir) {
+ t.Fatal("temp dir not writable")
+ }
+ if entries, _ := os.ReadDir(dir); len(entries) != 0 {
+ t.Fatal("probe file left behind")
+ }
+ if dirWritable(filepath.Join(dir, "missing")) {
+ t.Fatal("missing dir writable")
+ }
+}
diff --git a/internal/updater/registry_other.go b/internal/updater/registry_other.go
new file mode 100644
index 0000000..5f17b6e
--- /dev/null
+++ b/internal/updater/registry_other.go
@@ -0,0 +1,5 @@
+//go:build !windows
+
+package updater
+
+func registeredInstallLocations() []string { return nil }
diff --git a/internal/updater/registry_windows.go b/internal/updater/registry_windows.go
new file mode 100644
index 0000000..a7dcff2
--- /dev/null
+++ b/internal/updater/registry_windows.go
@@ -0,0 +1,22 @@
+package updater
+
+import "golang.org/x/sys/windows/registry"
+
+const uninstallKey = `Software\Microsoft\Windows\CurrentVersion\Uninstall\LowQuery`
+
+// registeredInstallLocations reads InstallLocation of the setup's uninstall
+// entry, per user first, then per machine. Read only.
+func registeredInstallLocations() []string {
+ var out []string
+ for _, root := range []registry.Key{registry.CURRENT_USER, registry.LOCAL_MACHINE} {
+ k, err := registry.OpenKey(root, uninstallKey, registry.QUERY_VALUE)
+ if err != nil {
+ continue
+ }
+ if v, _, err := k.GetStringValue("InstallLocation"); err == nil && v != "" {
+ out = append(out, v)
+ }
+ k.Close()
+ }
+ return out
+}
diff --git a/internal/updater/signature.go b/internal/updater/signature.go
new file mode 100644
index 0000000..8016f07
--- /dev/null
+++ b/internal/updater/signature.go
@@ -0,0 +1,177 @@
+package updater
+
+import (
+ "bytes"
+ "encoding/base64"
+ "errors"
+ "fmt"
+ "io"
+ "os"
+ "path/filepath"
+ "strconv"
+ "strings"
+ "time"
+
+ "aead.dev/minisign"
+)
+
+// Signatures are Tauri updater signatures: base64 of a minisign signature
+// file. tauri signer sign writes them with the untrusted comment below and a
+// trusted comment of tab-separated fields, `timestamp:\tfile:`
+// and, when signed for a version, `\tversion:`.
+const untrustedComment = "signature from tauri secret key"
+
+// ErrBadSignature reports a package that does not match its signature.
+var ErrBadSignature = errors.New("the update's signature does not match: it was not installed")
+
+// ParsePublicKey decodes a Tauri public key (base64 of a minisign public key
+// file).
+func ParsePublicKey(encoded string) (minisign.PublicKey, error) {
+ var key minisign.PublicKey
+ text, err := base64.StdEncoding.DecodeString(strings.TrimSpace(encoded))
+ if err != nil {
+ return key, fmt.Errorf("invalid public key: %w", err)
+ }
+ if err := key.UnmarshalText(bytes.TrimSpace(text)); err != nil {
+ return key, fmt.Errorf("invalid public key: %w", err)
+ }
+ return key, nil
+}
+
+// ParseSignature decodes a Tauri signature (base64 of a minisign signature).
+func ParseSignature(encoded string) (minisign.Signature, error) {
+ var sig minisign.Signature
+ text, err := base64.StdEncoding.DecodeString(strings.TrimSpace(encoded))
+ if err != nil {
+ return sig, fmt.Errorf("invalid signature: %w", err)
+ }
+ if err := sig.UnmarshalText(text); err != nil {
+ return sig, fmt.Errorf("invalid signature: %w", err)
+ }
+ return sig, nil
+}
+
+// VerifyFile checks the file at path against signature with publicKey, as
+// the Tauri updater does: minisign signature (prehashed or legacy) and, when
+// the trusted comment names a version, that it is the announced one.
+func VerifyFile(path, signature, publicKey, announcedVersion string) error {
+ key, err := ParsePublicKey(publicKey)
+ if err != nil {
+ return err
+ }
+ sig, err := ParseSignature(signature)
+ if err != nil {
+ return err
+ }
+ if sig.KeyID != key.ID() {
+ return fmt.Errorf("%w (signed with key %X, expected %X)", ErrBadSignature, sig.KeyID, key.ID())
+ }
+ raw, _ := base64.StdEncoding.DecodeString(strings.TrimSpace(signature))
+ f, err := os.Open(path)
+ if err != nil {
+ return err
+ }
+ defer f.Close()
+ var ok bool
+ if sig.Algorithm == minisign.HashEdDSA {
+ r := minisign.NewReader(f)
+ if _, err := io.Copy(io.Discard, r); err != nil {
+ return err
+ }
+ ok = r.Verify(key, raw)
+ } else {
+ data, err := io.ReadAll(f)
+ if err != nil {
+ return err
+ }
+ ok = minisign.Verify(key, data, raw)
+ }
+ if !ok {
+ return ErrBadSignature
+ }
+ // The trusted comment is covered by the signature, so it is only read
+ // once the signature holds.
+ return checkSignedVersion(sig.TrustedComment, announcedVersion)
+}
+
+// checkSignedVersion rejects a manifest that pairs a version number with the
+// package of another release.
+func checkSignedVersion(trustedComment, announced string) error {
+ signed, ok := signedVersion(trustedComment)
+ if !ok {
+ return nil
+ }
+ if strings.TrimPrefix(signed, "v") == strings.TrimPrefix(announced, "v") {
+ return nil
+ }
+ return fmt.Errorf("the update was signed for version %s, not %s: it was not installed", signed, announced)
+}
+
+func signedVersion(trustedComment string) (string, bool) {
+ for _, field := range strings.Split(trustedComment, "\t") {
+ if v, ok := strings.CutPrefix(field, "version:"); ok {
+ return v, true
+ }
+ }
+ return "", false
+}
+
+// LoadSecretKey decodes a Tauri private key (base64 of a minisign secret key
+// file, usually scrypt-encrypted) with its password, which may be empty.
+func LoadSecretKey(encoded, password string) (minisign.PrivateKey, error) {
+ text := []byte(strings.TrimSpace(encoded))
+ if !bytes.HasPrefix(text, []byte("untrusted comment:")) {
+ decoded, err := base64.StdEncoding.DecodeString(string(text))
+ if err != nil {
+ return minisign.PrivateKey{}, errors.New("the private key is not valid base64")
+ }
+ text = bytes.TrimSpace(decoded)
+ }
+ text = bytes.ReplaceAll(text, []byte("\r\n"), []byte("\n"))
+ if minisign.IsEncrypted(text) {
+ key, err := minisign.DecryptKey(password, text)
+ if err != nil {
+ return minisign.PrivateKey{}, errors.New("could not decrypt the private key: wrong password?")
+ }
+ return key, nil
+ }
+ var key minisign.PrivateKey
+ if err := key.UnmarshalText(text); err != nil {
+ return minisign.PrivateKey{}, errors.New("the private key is not a minisign secret key")
+ }
+ return key, nil
+}
+
+// SignFile signs the file at path as tauri signer sign does and returns the
+// content of its .sig file. version, when not empty, is bound into the
+// trusted comment.
+func SignFile(key minisign.PrivateKey, path, version string, now time.Time) (string, error) {
+ name := filepath.Base(path)
+ if strings.ContainsAny(name, "\t\r\n") {
+ return "", fmt.Errorf("%q cannot be signed: its name contains a tab or newline", name)
+ }
+ if strings.ContainsAny(version, "\t\r\n") {
+ return "", fmt.Errorf("version %q contains a tab or newline", version)
+ }
+ comment := "timestamp:" + strconv.FormatInt(now.Unix(), 10) + "\tfile:" + name
+ if version != "" {
+ comment += "\tversion:" + version
+ }
+ return signFileWithComment(key, path, comment)
+}
+
+func signFileWithComment(key minisign.PrivateKey, path, trustedComment string) (string, error) {
+ f, err := os.Open(path)
+ if err != nil {
+ return "", err
+ }
+ defer f.Close()
+ r := minisign.NewReader(f)
+ if _, err := io.Copy(io.Discard, r); err != nil {
+ return "", err
+ }
+ // Prehashed (BLAKE2b-512) like rust-minisign; the text ends with a newline
+ // like its SignatureBox, so the bytes match what Tauri writes.
+ text := r.SignWithComments(key, trustedComment, untrustedComment)
+ return base64.StdEncoding.EncodeToString(text), nil
+}
diff --git a/internal/updater/signature_test.go b/internal/updater/signature_test.go
new file mode 100644
index 0000000..d284e9c
--- /dev/null
+++ b/internal/updater/signature_test.go
@@ -0,0 +1,180 @@
+package updater
+
+import (
+ "encoding/base64"
+ "errors"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+ "time"
+
+ "aead.dev/minisign"
+)
+
+// testdata holds a throwaway key made with `tauri signer generate -p
+// throwaway-pass` (tauri-cli 2.12.3) and payload.bin signed by `tauri signer
+// sign`, without and with --app-version 1.2.3. other.key.pub is an unrelated
+// key.
+const throwawayPassword = "throwaway-pass"
+
+func readTestdata(t *testing.T, name string) string {
+ t.Helper()
+ b, err := os.ReadFile(filepath.Join("testdata", name))
+ if err != nil {
+ t.Fatal(err)
+ }
+ return string(b)
+}
+
+func throwawayKey(t *testing.T) minisign.PrivateKey {
+ t.Helper()
+ key, err := LoadSecretKey(readTestdata(t, "throwaway.key"), throwawayPassword)
+ if err != nil {
+ t.Fatal(err)
+ }
+ return key
+}
+
+// The key every release since 0.1 is signed with; existing installs only
+// accept updates signed by it.
+func TestPublicKeyID(t *testing.T) {
+ key, err := ParsePublicKey(PublicKey)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if key.ID() != 0xC3B42EFDD4E426AB {
+ t.Fatalf("key id %X", key.ID())
+ }
+}
+
+func TestVerifyTauriSignatures(t *testing.T) {
+ pub := readTestdata(t, "throwaway.key.pub")
+ payload := filepath.Join("testdata", "payload.bin")
+ plain := readTestdata(t, "payload.bin.sig")
+ versioned := readTestdata(t, "payload.bin.v1.2.3.sig")
+
+ if err := VerifyFile(payload, plain, pub, "4.5.6"); err != nil {
+ t.Fatalf("unversioned signature: %v", err)
+ }
+ for _, v := range []string{"1.2.3", "v1.2.3"} {
+ if err := VerifyFile(payload, versioned, pub, v); err != nil {
+ t.Fatalf("versioned signature, %s: %v", v, err)
+ }
+ }
+ if err := VerifyFile(payload, versioned, pub, "1.2.4"); err == nil || !strings.Contains(err.Error(), "signed for version 1.2.3") {
+ t.Fatalf("version mismatch accepted: %v", err)
+ }
+}
+
+func TestVerifyRejectsTamperedFile(t *testing.T) {
+ data := []byte(readTestdata(t, "payload.bin"))
+ data[100] ^= 1
+ path := filepath.Join(t.TempDir(), "payload.bin")
+ if err := os.WriteFile(path, data, 0o644); err != nil {
+ t.Fatal(err)
+ }
+ err := VerifyFile(path, readTestdata(t, "payload.bin.sig"), readTestdata(t, "throwaway.key.pub"), "")
+ if !errors.Is(err, ErrBadSignature) {
+ t.Fatalf("got %v", err)
+ }
+}
+
+func TestVerifyRejectsWrongKey(t *testing.T) {
+ err := VerifyFile(filepath.Join("testdata", "payload.bin"), readTestdata(t, "payload.bin.sig"), readTestdata(t, "other.key.pub"), "")
+ if !errors.Is(err, ErrBadSignature) {
+ t.Fatalf("got %v", err)
+ }
+ // Nor the key LowQuery ships with.
+ err = VerifyFile(filepath.Join("testdata", "payload.bin"), readTestdata(t, "payload.bin.sig"), PublicKey, "")
+ if !errors.Is(err, ErrBadSignature) {
+ t.Fatalf("got %v", err)
+ }
+}
+
+func TestVerifyRejectsTamperedTrustedComment(t *testing.T) {
+ text, _ := base64.StdEncoding.DecodeString(readTestdata(t, "payload.bin.v1.2.3.sig"))
+ forged := strings.Replace(string(text), "version:1.2.3", "version:9.9.9", 1)
+ sig := base64.StdEncoding.EncodeToString([]byte(forged))
+ err := VerifyFile(filepath.Join("testdata", "payload.bin"), sig, readTestdata(t, "throwaway.key.pub"), "9.9.9")
+ if !errors.Is(err, ErrBadSignature) {
+ t.Fatalf("got %v", err)
+ }
+}
+
+// The .sig SignFile writes has the layout tauri signer sign writes; Ed25519
+// signatures from rust-minisign are randomized, so the bytes differ only in
+// the signatures and the timestamp.
+func TestSignMatchesTauriFormat(t *testing.T) {
+ key := throwawayKey(t)
+ payload := filepath.Join("testdata", "payload.bin")
+ now := time.Unix(1796409937, 0)
+ for _, version := range []string{"", "1.2.3"} {
+ got, err := SignFile(key, payload, version, now)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if strings.ContainsAny(got, "\r\n") {
+ t.Fatal(".sig content must be one base64 line without a newline")
+ }
+ want := readTestdata(t, "payload.bin.sig")
+ comment := "timestamp:1796409937\tfile:payload.bin"
+ if version != "" {
+ want = readTestdata(t, "payload.bin.v1.2.3.sig")
+ comment += "\tversion:1.2.3"
+ }
+ gotText, _ := base64.StdEncoding.DecodeString(got)
+ wantText, _ := base64.StdEncoding.DecodeString(want)
+ gl, wl := strings.Split(string(gotText), "\n"), strings.Split(string(wantText), "\n")
+ if len(gl) != 5 || len(wl) != 5 || gl[4] != "" || wl[4] != "" {
+ t.Fatalf("line layout: got %q want %q", gl, wl)
+ }
+ if gl[0] != wl[0] {
+ t.Fatalf("untrusted comment %q, want %q", gl[0], wl[0])
+ }
+ // Algorithm (ED, prehashed) and key id lead the signature line.
+ if gl[1][:12] != wl[1][:12] || len(gl[1]) != len(wl[1]) || len(gl[3]) != len(wl[3]) {
+ t.Fatalf("signature line %q, want like %q", gl[1], wl[1])
+ }
+ if gl[2] != "trusted comment: "+comment {
+ t.Fatalf("trusted comment %q", gl[2])
+ }
+ if err := VerifyFile(payload, got, readTestdata(t, "throwaway.key.pub"), "1.2.3"); err != nil {
+ t.Fatal(err)
+ }
+ }
+}
+
+func TestLoadSecretKey(t *testing.T) {
+ encoded := readTestdata(t, "throwaway.key")
+ if _, err := LoadSecretKey(encoded, "wrong"); err == nil {
+ t.Fatal("wrong password accepted")
+ }
+ if _, err := LoadSecretKey("not base64!", ""); err == nil {
+ t.Fatal("garbage accepted")
+ }
+ // The decoded key file (minisign's own format) works too.
+ text, _ := base64.StdEncoding.DecodeString(encoded)
+ key, err := LoadSecretKey(string(text), throwawayPassword)
+ if err != nil {
+ t.Fatal(err)
+ }
+ pub, _ := ParsePublicKey(readTestdata(t, "throwaway.key.pub"))
+ if key.ID() != pub.ID() {
+ t.Fatalf("key id %X, public key id %X", key.ID(), pub.ID())
+ }
+ // An unencrypted key.
+ raw, _ := key.MarshalText()
+ if _, err := LoadSecretKey(base64.StdEncoding.EncodeToString(raw), ""); err != nil {
+ t.Fatal(err)
+ }
+}
+
+func TestSignRejectsTabInName(t *testing.T) {
+ if _, err := SignFile(throwawayKey(t), "a\tb", "", time.Now()); err == nil {
+ t.Fatal("tab accepted")
+ }
+ if _, err := SignFile(throwawayKey(t), filepath.Join("testdata", "payload.bin"), "1\n2", time.Now()); err == nil {
+ t.Fatal("newline in version accepted")
+ }
+}
diff --git a/internal/updater/testdata/other.key.pub b/internal/updater/testdata/other.key.pub
new file mode 100644
index 0000000..10b6519
--- /dev/null
+++ b/internal/updater/testdata/other.key.pub
@@ -0,0 +1 @@
+dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDg5NUJGRDBERkY2RDg1MDkKUldRSmhXMy9EZjFiaVVKYkFLZzNtc3VHcU9DbHRtYWtGb3NtdllFZVhJOFZLdGFVaFd0VWVvWUEK
\ No newline at end of file
diff --git a/internal/updater/testdata/payload.bin b/internal/updater/testdata/payload.bin
new file mode 100644
index 0000000..334d115
Binary files /dev/null and b/internal/updater/testdata/payload.bin differ
diff --git a/internal/updater/testdata/payload.bin.sig b/internal/updater/testdata/payload.bin.sig
new file mode 100644
index 0000000..52f3b30
--- /dev/null
+++ b/internal/updater/testdata/payload.bin.sig
@@ -0,0 +1 @@
+dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVUeEV4UGJ0MzVocDd5aUhodHZHQnk3Zlo3MFdCYXNqU04reWFaZk9OTTNyTmEwV3hwc1RsOFZBb2FJL0NzSkxROHpyeDY5VFR5YTJoUzRycXQrU29xZytQSU5RMGxGUHdVPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk2NDA5OTM3CWZpbGU6cGF5bG9hZC5iaW4KSmJlckdBTnVIQ1JtMjdUZVZFQXhBeUo3M1NkWlJhbFl3Q1RFUVNING55SlNwV2VtYUw5ZDd3akQ1SjRnVzBqNnBGRGRsSHhOcVNrRDV3YmNHQVkvQ1E9PQo=
\ No newline at end of file
diff --git a/internal/updater/testdata/payload.bin.v1.2.3.sig b/internal/updater/testdata/payload.bin.v1.2.3.sig
new file mode 100644
index 0000000..eacbe93
--- /dev/null
+++ b/internal/updater/testdata/payload.bin.v1.2.3.sig
@@ -0,0 +1 @@
+dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVUeEV4UGJ0MzVocDVZbm1MUWMzdlp6NHN0T0VhTHZ3OVN3ZHdJejlHQklXMHA1c2hranBobTFrR21TU01uWG8ydkRjUjMzd1AyNFFwakpXSU5WU01kYWY0MkJNQjVFb2dzPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk2NDA5OTM3CWZpbGU6cGF5bG9hZC5iaW4JdmVyc2lvbjoxLjIuMwpsTUtEbTA3REp5OWVTNTRBWVZwMndyMjJnRlNjNEVEQzNIczV4K011Vm1xelFwR2dSWVhZTS92MVlnS1lWV3l1dk1xRmxNa08rTkJCakNiZ25KYU1DZz09Cg==
\ No newline at end of file
diff --git a/internal/updater/testdata/throwaway.key b/internal/updater/testdata/throwaway.key
new file mode 100644
index 0000000..9153060
--- /dev/null
+++ b/internal/updater/testdata/throwaway.key
@@ -0,0 +1 @@
+dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5NnR4OGc2Ump0N1FkaWJEWkNqKzZRSWFtSDR2NytYbktCeVlvNk9ha0dKMEFBQkFBQUFBQUFBQUFBQUlBQUFBQXVZZFNUcjRSOTRpaXY3Vm5uSHNncXFiV1FscEpaVDRaQlpFS3lpVzFEc0lUbnlvVjIzanZSNFBMa01qR2NkQ3kvaUtFakFid0poR0RTMTBtNSs4ckFacEZsT2J0MElJbEhVbHhldEhTbTNBVE9LNGdrREFDWTBJRUF3SzREMTVYT3d3NVppS1JweGM9Cg==
\ No newline at end of file
diff --git a/internal/updater/testdata/throwaway.key.pub b/internal/updater/testdata/throwaway.key.pub
new file mode 100644
index 0000000..62d1471
--- /dev/null
+++ b/internal/updater/testdata/throwaway.key.pub
@@ -0,0 +1 @@
+dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEE3NjE3RUI3REIxMzEzRjEKUldUeEV4UGJ0MzVocHh1djE5eXN3M0NDeVpJMjJqT05vYW5lUkQ3aEYybFJuUWpEVGJoUXBsSGYK
\ No newline at end of file
diff --git a/internal/updater/updater.go b/internal/updater/updater.go
new file mode 100644
index 0000000..46a770e
--- /dev/null
+++ b/internal/updater/updater.go
@@ -0,0 +1,19 @@
+// Package updater updates LowQuery from GitHub Releases with the same
+// manifest (latest.json) and signatures as the Tauri updater, so Tauri
+// installs and Go installs read one manifest and trust one key.
+//
+// The flow: FetchManifest, Manifest.Select for this platform, Download
+// (which verifies the minisign signature against PublicKey), then Install
+// and Relaunch. Detect tells whether this copy can install updates at all.
+package updater
+
+// PublicKey verifies every update: base64 of a minisign public key file, the
+// same key the Tauri builds trusted (plugins.updater.pubkey). Changing it
+// strands every install that trusts the old key.
+const PublicKey = "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEMzQjQyRUZERDRFNDI2QUIKUldTckp1VFUvUzYwdzYwaVpFS1dtRjhzeFZxbkt4VEpjMUorbEN2emk1MjdHektJczlTcXl4SkYK"
+
+// ManifestURL is the manifest every release publishes.
+const ManifestURL = "https://github.com/LowBloat/LowQuery/releases/latest/download/latest.json"
+
+// ProgressEvent is the event download progress is sent as.
+const ProgressEvent = "update-progress"
diff --git a/main.go b/main.go
index 47be1f1..ea9738c 100644
--- a/main.go
+++ b/main.go
@@ -7,6 +7,7 @@ import (
"log"
"os"
"path/filepath"
+ "runtime"
"strconv"
"strings"
"sync"
@@ -16,6 +17,7 @@ import (
"github.com/LowBloat/LowQuery/internal/app"
"github.com/LowBloat/LowQuery/internal/mcp"
+ "github.com/LowBloat/LowQuery/internal/menubar"
"github.com/LowBloat/LowQuery/internal/profiles"
)
@@ -98,7 +100,19 @@ func main() {
})
frame := &mainWindow{win: win}
backend.SetWindow(frame)
+ backend.SetQuit(wails.Quit)
backend.SetEmitter(func(event string, data any) { wails.Event.Emit(event, data) })
+ // macOS has a global menu bar: the page describes its menus and Go
+ // builds them. Until it does, the bar holds only the standard menus, not
+ // Wails' default one with Reload and developer tools. Windows and Linux
+ // keep the menus the page draws in its title bar.
+ if runtime.GOOS == "darwin" {
+ bar := menubar.New(wails.Menu.SetApplicationMenu, func(id string) {
+ backend.Emit(app.MenuEvent, app.MenuClick{ID: id})
+ })
+ bar.Set(app.BuildMenuBar("LowQuery", app.MenuBarDescription{}))
+ backend.SetMenuBar(bar.Set)
+ }
time.AfterFunc(firstShowFallback, frame.showFirstTime)
if err := wails.Run(); err != nil {
diff --git a/main_windows.go b/main_windows.go
new file mode 100644
index 0000000..6ff4908
--- /dev/null
+++ b/main_windows.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "unsafe"
+
+ "golang.org/x/sys/windows"
+)
+
+// The Start Menu shortcut the setup creates carries this ID, as the Tauri
+// builds' did, so a window started by the setup or at login groups with a
+// pinned shortcut.
+const appUserModelID = "dev.lowbloat.lowquery"
+
+func init() {
+ id, err := windows.UTF16PtrFromString(appUserModelID)
+ if err != nil {
+ return
+ }
+ proc := windows.NewLazySystemDLL("shell32.dll").NewProc("SetCurrentProcessExplicitAppUserModelID")
+ if proc.Find() == nil {
+ _, _, _ = proc.Call(uintptr(unsafe.Pointer(id)))
+ }
+}
diff --git a/package.json b/package.json
index f006821..7e93657 100644
--- a/package.json
+++ b/package.json
@@ -20,8 +20,10 @@
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"test": "bun test",
- "tauri": "tauri",
- "version:check": "bun scripts/check-version.mjs"
+ "version:check": "bun scripts/check-version.mjs",
+ "package:windows": "bash packaging/windows/build.sh",
+ "package:linux": "bash packaging/linux/build.sh",
+ "package:macos": "bash packaging/macos/build.sh"
},
"dependencies": {
"@codeatlasdev/ui": "^4.5.0",
@@ -36,17 +38,11 @@
"@lezer/highlight": "^1.2.5",
"@lucide/svelte": "^1.59.0",
"@tanstack/svelte-table": "^9.3.1",
- "@tauri-apps/api": "^2.12.4",
- "@tauri-apps/plugin-dialog": "^2.8.3",
- "@tauri-apps/plugin-opener": "^2.7.2",
- "@tauri-apps/plugin-process": "^2.4.0",
- "@tauri-apps/plugin-updater": "^2.14.0",
"@wailsio/runtime": "3.1.0",
"codemirror": "^6.0.2"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^7.3.1",
- "@tauri-apps/cli": "^2.12.3",
"@tsconfig/svelte": "^5.0.8",
"@types/bun": "^1.4.3",
"svelte": "^5.57.2",
diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD
index 44f6bf4..dd7e40b 100644
--- a/packaging/arch/PKGBUILD
+++ b/packaging/arch/PKGBUILD
@@ -16,7 +16,7 @@ options=('!strip')
source=(
"lowquery-${pkgver}.tar.gz::https://github.com/LowBloat/LowQuery/releases/download/v${pkgver}/LowQuery-${pkgver}-linux-x64-portable.tar.gz"
"lowquery.desktop::https://raw.githubusercontent.com/LowBloat/LowQuery/v${pkgver}/packaging/arch/lowquery.desktop"
- "lowquery.png::https://raw.githubusercontent.com/LowBloat/LowQuery/v${pkgver}/src-tauri/icons/128x128.png"
+ "lowquery.png::https://raw.githubusercontent.com/LowBloat/LowQuery/v${pkgver}/packaging/icons/128x128.png"
)
sha256sums=('__SHA256_PORTABLE__' '__SHA256_DESKTOP__' '__SHA256_ICON__')
diff --git a/packaging/arch/build.sh b/packaging/arch/build.sh
new file mode 100644
index 0000000..761cd96
--- /dev/null
+++ b/packaging/arch/build.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# Builds the native Arch Linux package (pacman -U) with makepkg in an Arch
+# container, from build/linux/lowquery (run packaging/linux/build.sh first):
+# build/release/LowQuery--linux-x86_64.pkg.tar.zst
+# Needs Docker and python3.
+set -euo pipefail
+cd "$(dirname "$0")/../.."
+source packaging/common.sh
+
+version="$(app_version)"
+if [ ! -x build/linux/lowquery ]; then
+ echo "build/linux/lowquery is missing: run packaging/linux/build.sh first." >&2
+ exit 1
+fi
+arch_build="$PWD/build/arch"
+# The container leaves files owned by its build user.
+rm -rf "$arch_build" 2>/dev/null || sudo rm -rf "$arch_build"
+mkdir -p "$arch_build" "$RELEASE_DIR"
+cp build/linux/lowquery "$arch_build/lowquery"
+cp packaging/icons/128x128.png "$arch_build/lowquery.png"
+cp packaging/arch/lowquery.desktop "$arch_build/lowquery.desktop"
+python3 .github/scripts/render_pkgbuild.py local "$version" "$arch_build"
+docker run --rm -v "$arch_build":/workspace -w /workspace archlinux:base-devel bash -c "
+ useradd -m builder && chown -R builder:builder /workspace &&
+ su builder -c 'makepkg -f --nodeps' &&
+ pacman -Qip *.pkg.tar.zst && pacman -Qlp *.pkg.tar.zst
+"
+package="$(find "$arch_build" -maxdepth 1 -name 'lowquery-bin-*.pkg.tar.zst' ! -name '*-debug-*' | head -n 1)"
+cp "$package" "$RELEASE_DIR/LowQuery-$version-linux-x86_64.pkg.tar.zst"
diff --git a/packaging/arch/lowquery.desktop b/packaging/arch/lowquery.desktop
index 3fec228..5b03da5 100644
--- a/packaging/arch/lowquery.desktop
+++ b/packaging/arch/lowquery.desktop
@@ -7,4 +7,4 @@ Terminal=false
Type=Application
Categories=Development;Database;
Keywords=sql;database;postgresql;oracle;mysql;mariadb;sqlserver;sqlite;redis;cassandra;
-StartupWMClass=LowQuery
+StartupWMClass=lowquery
diff --git a/packaging/common.sh b/packaging/common.sh
new file mode 100644
index 0000000..1c2eeeb
--- /dev/null
+++ b/packaging/common.sh
@@ -0,0 +1,62 @@
+# Shared by the packaging scripts. Source it from the repository root.
+#
+# Release files go to build/release/ (git-ignored) under the names the
+# releases have always used; intermediate files stay in build//.
+
+RELEASE_DIR=build/release
+
+# The Wails version in go.mod, so the wails3 tool matches the library.
+wails_version() {
+ go list -m -f '{{.Version}}' github.com/wailsapp/wails/v3
+}
+
+wails3() {
+ local tags=""
+ # On Linux the CLI links WebKitGTK through cgo; gtk3 picks WebKitGTK 4.1.
+ if [ "$(uname -s)" = Linux ]; then
+ tags=gtk3
+ fi
+ go run -tags "$tags" "github.com/wailsapp/wails/v3/cmd/wails3@$(wails_version)" "$@"
+}
+
+# VERSION from the environment (the release passes the checked tag version,
+# CI a test version), otherwise package.json, which main.go embeds.
+app_version() {
+ local version="${VERSION:-}"
+ if [ -z "$version" ]; then
+ version="$(sed -nE 's/^[[:space:]]*"version":[[:space:]]*"([^"]+)".*/\1/p' package.json | head -n 1)"
+ fi
+ if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ echo "Version '$version' is not X.Y.Z." >&2
+ return 1
+ fi
+ printf '%s\n' "$version"
+}
+
+# main.go embeds dist/, so the interface has to be built first.
+require_dist() {
+ if [ ! -f dist/index.html ]; then
+ echo "dist/index.html is missing: run 'bun run build' first." >&2
+ return 1
+ fi
+}
+
+# Replaces @VERSION@ in a template.
+render() {
+ sed "s/@VERSION@/$2/g" "$1" > "$3"
+}
+
+# .sha256 next to every release file, in sha256sum's format.
+write_checksums() {
+ local dir="$1" file hash
+ for file in "$dir"/*; do
+ case "$file" in *.sig | *.sha256) continue ;; esac
+ [ -f "$file" ] || continue
+ if command -v sha256sum >/dev/null 2>&1; then
+ hash="$(sha256sum "$file" | cut -d ' ' -f 1)"
+ else
+ hash="$(shasum -a 256 "$file" | cut -d ' ' -f 1)"
+ fi
+ printf '%s %s\n' "$hash" "$(basename "$file")" > "$file.sha256"
+ done
+}
diff --git a/src-tauri/icons/128x128.png b/packaging/icons/128x128.png
similarity index 100%
rename from src-tauri/icons/128x128.png
rename to packaging/icons/128x128.png
diff --git a/src-tauri/icons/128x128@2x.png b/packaging/icons/128x128@2x.png
similarity index 100%
rename from src-tauri/icons/128x128@2x.png
rename to packaging/icons/128x128@2x.png
diff --git a/src-tauri/icons/32x32.png b/packaging/icons/32x32.png
similarity index 100%
rename from src-tauri/icons/32x32.png
rename to packaging/icons/32x32.png
diff --git a/src-tauri/icons/icon.icns b/packaging/icons/icon.icns
similarity index 100%
rename from src-tauri/icons/icon.icns
rename to packaging/icons/icon.icns
diff --git a/src-tauri/icons/icon.ico b/packaging/icons/icon.ico
similarity index 100%
rename from src-tauri/icons/icon.ico
rename to packaging/icons/icon.ico
diff --git a/packaging/linux/LowQuery.desktop b/packaging/linux/LowQuery.desktop
new file mode 100644
index 0000000..5b03da5
--- /dev/null
+++ b/packaging/linux/LowQuery.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=LowQuery
+Comment=Light SQL client for PostgreSQL, Oracle, MySQL, MariaDB, SQL Server, SQLite, Redis and Apache Cassandra
+Exec=lowquery
+Icon=lowquery
+Terminal=false
+Type=Application
+Categories=Development;Database;
+Keywords=sql;database;postgresql;oracle;mysql;mariadb;sqlserver;sqlite;redis;cassandra;
+StartupWMClass=lowquery
diff --git a/packaging/linux/build.sh b/packaging/linux/build.sh
new file mode 100644
index 0000000..a4cb067
--- /dev/null
+++ b/packaging/linux/build.sh
@@ -0,0 +1,59 @@
+#!/usr/bin/env bash
+# Builds the Linux release files from the Go app (x86_64):
+# build/release/LowQuery--linux-x64.deb (updater file)
+# build/release/LowQuery--linux-x64.rpm (updater file)
+# build/release/LowQuery--linux-x64.AppImage (updater file)
+# build/release/LowQuery--linux-x64-portable.tar.gz LowQuery, README, LICENSE
+# and build/linux/lowquery, which packaging/arch/build.sh packages for pacman.
+# Needs dist/ (bun run build), Go, a C compiler, libgtk-3-dev and
+# libwebkit2gtk-4.1-dev. Build on the oldest distro the AppImage should run on
+# (the release uses Ubuntu 22.04, as the Tauri builds did).
+set -euo pipefail
+cd "$(dirname "$0")/../.."
+source packaging/common.sh
+
+NFPM_VERSION=v2.48.0
+LINUXDEPLOY_TAG=1-alpha-20251107-1
+LINUXDEPLOY_SHA256=c20cd71e3a4e3b80c3483cef793cda3f4e990aca14014d23c544ca3ce1270b4d
+
+version="$(app_version)"
+require_dist
+work=build/linux
+rm -rf "$work"
+mkdir -p "$work" "$RELEASE_DIR"
+
+# gtk3: WebKitGTK 4.1 and GTK 3, which the Tauri builds used; Wails' default
+# Linux backend is GTK 4 with WebKitGTK 6.0.
+CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags production,gtk3 -trimpath \
+ -ldflags "-s -w" -o "$work/lowquery" .
+
+# .deb and .rpm (package low-query, /usr/bin/lowquery, as Tauri's).
+export VERSION="$version"
+for format in deb rpm; do
+ go run "github.com/goreleaser/nfpm/v2/cmd/nfpm@$NFPM_VERSION" package \
+ --config packaging/linux/nfpm.yaml --packager "$format" \
+ --target "$RELEASE_DIR/LowQuery-$version-linux-x64.$format"
+done
+
+# AppImage: wails3 copies the WebKit helper processes in and runs linuxdeploy
+# with its GTK plugin. linuxdeploy is pinned here; wails3 would otherwise
+# download the "continuous" build.
+appimage="$work/appimage"
+mkdir -p "$appimage"
+curl -fsSL -o "$appimage/linuxdeploy-x86_64.AppImage" \
+ "https://github.com/linuxdeploy/linuxdeploy/releases/download/$LINUXDEPLOY_TAG/linuxdeploy-x86_64.AppImage"
+echo "$LINUXDEPLOY_SHA256 $appimage/linuxdeploy-x86_64.AppImage" | sha256sum -c -
+cp packaging/icons/128x128@2x.png "$work/lowquery.png"
+wails3 generate appimage -binary "$work/lowquery" -icon "$work/lowquery.png" \
+ -desktopfile packaging/linux/LowQuery.desktop -outputdir "$work" -builddir "$appimage"
+mv "$work/lowquery-x86_64.AppImage" "$RELEASE_DIR/LowQuery-$version-linux-x64.AppImage"
+chmod 755 "$RELEASE_DIR/LowQuery-$version-linux-x64.AppImage"
+
+portable="$work/portable"
+mkdir -p "$portable"
+cp "$work/lowquery" "$portable/LowQuery"
+chmod 755 "$portable/LowQuery"
+cp README.md LICENSE "$portable/"
+tar -czf "$RELEASE_DIR/LowQuery-$version-linux-x64-portable.tar.gz" -C "$portable" .
+
+ls -l "$RELEASE_DIR"
diff --git a/packaging/linux/nfpm.yaml b/packaging/linux/nfpm.yaml
new file mode 100644
index 0000000..752a8cb
--- /dev/null
+++ b/packaging/linux/nfpm.yaml
@@ -0,0 +1,57 @@
+# .deb and .rpm of LowQuery, built by packaging/linux/build.sh with nfpm from
+# the repository root. VERSION comes from the environment.
+#
+# Same package name and files as the Tauri packages (0.5.x), so `dpkg -i` and
+# `rpm -U` (what their updater runs) upgrade a Tauri install in place.
+name: low-query
+arch: amd64
+platform: linux
+version: ${VERSION}
+version_schema: none
+maintainer: LowBloat
+vendor: LowBloat
+homepage: https://github.com/LowBloat/LowQuery
+license: AGPL-3.0-only
+section: devel
+priority: optional
+description: |-
+ Light SQL client for PostgreSQL, Oracle, MySQL, MariaDB, SQL Server, SQLite, Redis and Apache Cassandra
+ LowQuery is a lightweight SQL client for people who work with multiple databases, with a native driver for each one.
+
+contents:
+ - src: build/linux/lowquery
+ dst: /usr/bin/lowquery
+ file_info:
+ mode: 0755
+ - src: packaging/linux/LowQuery.desktop
+ dst: /usr/share/applications/LowQuery.desktop
+ file_info:
+ mode: 0644
+ - src: packaging/icons/32x32.png
+ dst: /usr/share/icons/hicolor/32x32/apps/lowquery.png
+ file_info:
+ mode: 0644
+ - src: packaging/icons/128x128.png
+ dst: /usr/share/icons/hicolor/128x128/apps/lowquery.png
+ file_info:
+ mode: 0644
+ # The Tauri packages put the 256 px icon here.
+ - src: packaging/icons/128x128@2x.png
+ dst: /usr/share/icons/hicolor/256x256@2/apps/lowquery.png
+ file_info:
+ mode: 0644
+
+overrides:
+ deb:
+ depends:
+ - libwebkit2gtk-4.1-0
+ - libgtk-3-0
+ rpm:
+ depends:
+ - libwebkit2gtk-4.1.so.0()(64bit)
+ - libgtk-3.so.0()(64bit)
+
+rpm:
+ summary: Light SQL client for PostgreSQL, Oracle, MySQL, MariaDB, SQL Server, SQLite, Redis and Apache Cassandra
+ group: Development/Tools
+ compression: gzip
diff --git a/packaging/macos/Info.plist b/packaging/macos/Info.plist
new file mode 100644
index 0000000..5abf2e7
--- /dev/null
+++ b/packaging/macos/Info.plist
@@ -0,0 +1,39 @@
+
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleDisplayName
+ LowQuery
+ CFBundleExecutable
+ lowquery
+ CFBundleIdentifier
+ dev.lowbloat.lowquery
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ LowQuery
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ @VERSION@
+ CFBundleVersion
+ @VERSION@
+ CSResourcesFileMapped
+
+ LSApplicationCategoryType
+ public.app-category.developer-tools
+ LSMinimumSystemVersion
+ 12.0
+ CFBundleIconFile
+ icon.icns
+ NSHighResolutionCapable
+
+ NSHumanReadableCopyright
+ Copyright © 2026 LowBloat. Licensed under AGPL-3.0-only.
+
+
diff --git a/packaging/macos/build.sh b/packaging/macos/build.sh
new file mode 100644
index 0000000..2e501db
--- /dev/null
+++ b/packaging/macos/build.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+# Builds the macOS release files from the Go app, on macOS:
+# build/release/LowQuery--macos-universal.app.tar.gz (updater file)
+# build/release/LowQuery--macos-universal.dmg (skipped with MACOS_DMG=0)
+# LowQuery.app is universal (arm64 + x86_64) and ad-hoc signed; the Tauri
+# updater swaps it in for the installed bundle.
+# Needs dist/ (bun run build), Go and the Xcode command line tools.
+set -euo pipefail
+cd "$(dirname "$0")/../.."
+source packaging/common.sh
+
+version="$(app_version)"
+require_dist
+work=build/macos
+rm -rf "$work"
+mkdir -p "$work" "$RELEASE_DIR"
+
+# Wails needs cgo; Go 1.25+ and Wails 3 support macOS 12 and later.
+export CGO_ENABLED=1 MACOSX_DEPLOYMENT_TARGET=12.0
+export CGO_CFLAGS="-mmacosx-version-min=12.0" CGO_LDFLAGS="-mmacosx-version-min=12.0"
+for arch in arm64 amd64; do
+ GOOS=darwin GOARCH="$arch" go build -tags production -trimpath \
+ -ldflags "-s -w" -o "$work/lowquery-$arch" .
+done
+
+app="$work/LowQuery.app"
+mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources"
+lipo -create -output "$app/Contents/MacOS/lowquery" "$work/lowquery-arm64" "$work/lowquery-amd64"
+chmod 755 "$app/Contents/MacOS/lowquery"
+cp packaging/icons/icon.icns "$app/Contents/Resources/icon.icns"
+render packaging/macos/Info.plist "$version" "$app/Contents/Info.plist"
+plutil -lint "$app/Contents/Info.plist"
+
+codesign --force --deep --sign - "$app"
+codesign --verify --deep --strict --verbose=2 "$app"
+
+# Entries rooted at LowQuery.app/ (no ./): the updater drops the first path
+# component. COPYFILE_DISABLE keeps AppleDouble (._*) files out.
+COPYFILE_DISABLE=1 tar -czf "$RELEASE_DIR/LowQuery-$version-macos-universal.app.tar.gz" -C "$work" LowQuery.app
+
+if [ "${MACOS_DMG:-1}" != "0" ]; then
+ staging="$work/dmg"
+ mkdir -p "$staging"
+ cp -R "$app" "$staging/"
+ ln -s /Applications "$staging/Applications"
+ dmg="$RELEASE_DIR/LowQuery-$version-macos-universal.dmg"
+ # hdiutil fails now and then on CI machines with "Resource busy".
+ for attempt in 1 2 3; do
+ if hdiutil create -volname LowQuery -srcfolder "$staging" -fs HFS+ -format UDZO -ov "$dmg"; then
+ break
+ fi
+ [ "$attempt" = 3 ] && exit 1
+ sleep 10
+ done
+fi
+
+ls -l "$RELEASE_DIR"
diff --git a/packaging/test/mcp-smoke.sh b/packaging/test/mcp-smoke.sh
new file mode 100644
index 0000000..66fac42
--- /dev/null
+++ b/packaging/test/mcp-smoke.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+# Usage: packaging/test/mcp-smoke.sh [args...]
+# Runs ` [args...] mcp`, the way AI clients start LowQuery, and checks
+# that it answers MCP initialize and tools/list over stdio. It needs no window
+# or display: main.go serves MCP before Wails starts.
+set -euo pipefail
+
+out="$(mktemp)"
+trap 'rm -f "$out"' EXIT
+requests='{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"ci","version":"0"}}}
+{"jsonrpc":"2.0","method":"notifications/initialized"}
+{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
+
+if command -v timeout >/dev/null 2>&1; then
+ limit=(timeout 60)
+else
+ limit=(perl -e 'alarm shift; exec @ARGV' 60)
+fi
+printf '%s\n' "$requests" | "${limit[@]}" "$@" mcp > "$out"
+cat "$out"
+grep -q '"serverInfo"' "$out"
+grep -q '"list_connections"' "$out"
+echo "MCP answered: $*"
diff --git a/packaging/test/windows-upgrade.ps1 b/packaging/test/windows-upgrade.ps1
new file mode 100644
index 0000000..941a6bb
--- /dev/null
+++ b/packaging/test/windows-upgrade.ps1
@@ -0,0 +1,158 @@
+# CI test of the Windows setup (never run it on a machine with a real install):
+# 1. installs the Tauri setup silently and starts that app;
+# 2. runs the new setup the way the Tauri updater does (/P /UPDATE /R /ARGS)
+# and checks that it closed the old app, replaced lowquery.exe with the Go
+# build, kept the Tauri registry values and shortcuts, and restarted the app;
+# 3. uninstalls silently and checks that files, shortcuts and registry entries
+# are gone while user data stays;
+# 4. does a fresh silent install and uninstall.
+param(
+ [Parameter(Mandatory)] [string] $TauriSetup,
+ [Parameter(Mandatory)] [string] $Setup,
+ [Parameter(Mandatory)] [string] $BuiltExe,
+ [Parameter(Mandatory)] [string] $Version
+)
+$ErrorActionPreference = 'Stop'
+
+$dir = Join-Path $env:LOCALAPPDATA 'LowQuery'
+$exe = Join-Path $dir 'lowquery.exe'
+$uninstaller = Join-Path $dir 'uninstall.exe'
+$uninstKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\LowQuery'
+$dirKey = 'HKCU:\Software\LowBloat\LowQuery'
+$startMenuLnk = Join-Path ([Environment]::GetFolderPath('Programs')) 'LowQuery.lnk'
+$desktopLnk = Join-Path ([Environment]::GetFolderPath('Desktop')) 'LowQuery.lnk'
+$valueNames = 'DisplayName', 'DisplayIcon', 'DisplayVersion', 'Publisher', 'InstallLocation',
+ 'UninstallString', 'MainBinaryName', 'NoModify', 'NoRepair', 'EstimatedSize'
+
+function Assert([bool] $condition, [string] $message) {
+ if (-not $condition) { throw "FAILED: $message" }
+ Write-Host "ok: $message"
+}
+
+function Invoke-Setup([string] $path, [string] $arguments) {
+ Write-Host "> $path $arguments"
+ $process = Start-Process -FilePath $path -ArgumentList $arguments -PassThru
+ $null = $process.Handle # keeps the exit code readable
+ # Only this process: the app it starts keeps running.
+ if (-not $process.WaitForExit(300000)) { throw "$path did not finish" }
+ Assert ($process.ExitCode -eq 0) "$([IO.Path]::GetFileName($path)) $arguments exits with 0 (got $($process.ExitCode))"
+}
+
+function Get-AppProcess {
+ @(Get-Process -Name lowquery -ErrorAction SilentlyContinue | Where-Object { $_.Path -eq $exe })
+}
+
+function Get-ShortcutTarget([string] $lnk) {
+ (New-Object -ComObject WScript.Shell).CreateShortcut($lnk).TargetPath
+}
+
+function Get-Values {
+ $key = Get-ItemProperty $uninstKey
+ $values = @{}
+ foreach ($name in $valueNames) { $values[$name] = $key.$name }
+ $values
+}
+
+# What AI clients do: `lowquery.exe mcp` over stdin and stdout.
+function Test-Mcp {
+ $info = New-Object System.Diagnostics.ProcessStartInfo $exe, 'mcp'
+ $info.UseShellExecute = $false
+ $info.RedirectStandardInput = $true
+ $info.RedirectStandardOutput = $true
+ $process = [System.Diagnostics.Process]::Start($info)
+ $process.StandardInput.WriteLine('{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"ci","version":"0"}}}')
+ $process.StandardInput.WriteLine('{"jsonrpc":"2.0","method":"notifications/initialized"}')
+ $process.StandardInput.WriteLine('{"jsonrpc":"2.0","id":2,"method":"tools/list"}')
+ $process.StandardInput.Close()
+ $output = $process.StandardOutput.ReadToEndAsync()
+ if (-not $process.WaitForExit(60000)) { $process.Kill(); throw 'lowquery.exe mcp did not exit' }
+ $text = $output.Result
+ Assert ($text -match '"serverInfo"' -and $text -match '"list_connections"') 'installed lowquery.exe mcp answers initialize and tools/list'
+}
+
+function Wait-Uninstalled {
+ Write-Host "> $uninstaller /S"
+ # The NSIS uninstaller copies itself to %TEMP% and returns at once.
+ Start-Process -FilePath $uninstaller -ArgumentList '/S'
+ $deadline = (Get-Date).AddSeconds(120)
+ while ((Test-Path $exe) -or (Test-Path $uninstKey) -or (Test-Path $uninstaller)) {
+ if ((Get-Date) -gt $deadline) { throw 'the uninstaller did not finish' }
+ Start-Sleep -Milliseconds 500
+ }
+ Start-Sleep -Seconds 2
+ Assert (-not (Test-Path $dir)) 'install folder removed'
+ Assert (-not (Test-Path $uninstKey)) 'uninstall entry removed'
+ Assert (-not (Test-Path $dirKey)) 'HKCU\Software\LowBloat\LowQuery removed'
+ Assert (-not (Test-Path $startMenuLnk)) 'Start Menu shortcut removed'
+ Assert (-not (Test-Path $desktopLnk)) 'desktop shortcut removed'
+ Assert ((Get-AppProcess).Count -eq 0) 'no LowQuery process left'
+}
+
+Write-Host '== Tauri 0.5.x install'
+Invoke-Setup $TauriSetup '/S'
+Assert (Test-Path $exe) 'Tauri lowquery.exe installed'
+$tauriValues = Get-Values
+Write-Host ($tauriValues | Out-String)
+Assert (Test-Path $startMenuLnk) 'Tauri Start Menu shortcut exists'
+$hadDesktopLnk = Test-Path $desktopLnk
+
+# The updater leaves the app closing while the setup starts.
+Start-Process -FilePath $exe
+Start-Sleep -Seconds 5
+$oldProcesses = Get-AppProcess
+if ($oldProcesses.Count -eq 0) {
+ Write-Host '::warning::The Tauri app did not stay running; closing a running app is not tested.'
+}
+
+Write-Host '== Update with the new setup, as the Tauri updater runs it'
+$updateStart = Get-Date
+Invoke-Setup $Setup '/P /UPDATE /R /ARGS'
+foreach ($old in $oldProcesses) {
+ Assert ($null -eq (Get-Process -Id $old.Id -ErrorAction SilentlyContinue)) "Tauri app (pid $($old.Id)) closed by the setup"
+}
+Assert ((Get-FileHash $exe).Hash -eq (Get-FileHash $BuiltExe).Hash) 'lowquery.exe is the Go build'
+Assert (Test-Path $uninstaller) 'uninstall.exe present'
+Assert (@(Get-ChildItem $dir).Count -eq 2) 'install folder holds lowquery.exe and uninstall.exe only'
+$values = Get-Values
+Write-Host ($values | Out-String)
+Assert ($values.DisplayVersion -eq $Version) "DisplayVersion is $Version"
+Assert ($values.EstimatedSize -gt 0) 'EstimatedSize set'
+foreach ($name in $valueNames | Where-Object { $_ -notin 'DisplayVersion', 'EstimatedSize' }) {
+ Assert ("$($values[$name])" -eq "$($tauriValues[$name])") "$name unchanged ($($values[$name]))"
+}
+Assert ((Get-ItemProperty $dirKey).'(default)' -eq $dir) 'HKCU\Software\LowBloat\LowQuery points at the install folder'
+Assert ((Get-ShortcutTarget $startMenuLnk) -eq $exe) 'Start Menu shortcut kept, opens lowquery.exe'
+Assert ((Test-Path $desktopLnk) -eq $hadDesktopLnk) 'desktop shortcut left as it was'
+
+$deadline = (Get-Date).AddSeconds(20)
+$started = @()
+while ($started.Count -eq 0 -and (Get-Date) -lt $deadline) {
+ $started = @(Get-AppProcess | Where-Object { $_.StartTime -ge $updateStart })
+ Start-Sleep -Milliseconds 500
+}
+Assert ($started.Count -gt 0) '/R started the updated app'
+
+Test-Mcp
+
+# User data lives outside the install folder and survives the uninstall.
+$marker = Join-Path $env:APPDATA 'LowBloat\LowQuery\config\ci-marker.txt'
+New-Item -ItemType Directory -Force (Split-Path $marker) | Out-Null
+Set-Content $marker 'keep'
+
+Write-Host '== Uninstall (closes the running app)'
+Wait-Uninstalled
+Assert (Test-Path $marker) 'user data kept'
+
+Write-Host '== Fresh silent install'
+Invoke-Setup $Setup '/S'
+Assert ((Get-FileHash $exe).Hash -eq (Get-FileHash $BuiltExe).Hash) 'lowquery.exe installed'
+$values = Get-Values
+Assert ($values.DisplayVersion -eq $Version) "DisplayVersion is $Version"
+Assert ($values.InstallLocation -eq "`"$dir`"") 'InstallLocation is the quoted install folder'
+Assert ($values.UninstallString -eq "`"$uninstaller`"") 'UninstallString is the quoted uninstaller'
+Assert ($values.MainBinaryName -eq 'lowquery.exe') 'MainBinaryName is lowquery.exe'
+Assert ((Get-ShortcutTarget $startMenuLnk) -eq $exe) 'Start Menu shortcut created'
+Assert ((Get-ShortcutTarget $desktopLnk) -eq $exe) 'desktop shortcut created'
+Assert ((Get-AppProcess).Count -eq 0) 'no restart without /R'
+Test-Mcp
+Wait-Uninstalled
diff --git a/packaging/windows/build.sh b/packaging/windows/build.sh
new file mode 100644
index 0000000..284bb97
--- /dev/null
+++ b/packaging/windows/build.sh
@@ -0,0 +1,59 @@
+#!/usr/bin/env bash
+# Builds the Windows release files from the Go app, in Git Bash:
+# build/release/LowQuery--windows-x64-setup.exe NSIS setup (updater file)
+# build/release/LowQuery--windows-x64-portable.zip LowQuery.exe, README, LICENSE
+# Needs dist/ (bun run build), Go and makensis (MAKENSIS overrides the path).
+set -euo pipefail
+cd "$(dirname "$0")/../.."
+source packaging/common.sh
+
+version="$(app_version)"
+require_dist
+work=build/windows
+rm -rf "$work"
+mkdir -p "$work" "$RELEASE_DIR"
+
+# Icon, version information and manifest (DPI awareness, Common Controls 6),
+# compiled into a .syso that go build links into package main. Wails' own
+# build generates it the same way and deletes it afterwards.
+render packaging/windows/info.json "$version" "$work/info.json"
+render packaging/windows/lowquery.exe.manifest "$version" "$work/lowquery.exe.manifest"
+syso="$PWD/wails_windows_amd64.syso"
+trap 'rm -f "$syso"' EXIT
+wails3 generate syso -arch amd64 -icon packaging/icons/icon.ico \
+ -manifest "$work/lowquery.exe.manifest" -info "$work/info.json" -out "$syso"
+
+GOOS=windows GOARCH=amd64 go build -tags production -trimpath \
+ -ldflags "-s -w -H windowsgui" -o "$work/lowquery.exe" .
+rm -f "$syso"
+
+makensis="${MAKENSIS:-}"
+if [ -z "$makensis" ]; then
+ for candidate in makensis "/c/Program Files (x86)/NSIS/makensis.exe" "/c/Program Files/NSIS/makensis.exe"; do
+ if command -v "$candidate" >/dev/null 2>&1; then
+ makensis="$candidate"
+ break
+ fi
+ done
+fi
+if [ -z "$makensis" ]; then
+ echo "makensis not found: install NSIS 3 or set MAKENSIS." >&2
+ exit 1
+fi
+setup="$RELEASE_DIR/LowQuery-$version-windows-x64-setup.exe"
+MSYS_NO_PATHCONV=1 "$makensis" -V3 -WX -INPUTCHARSET UTF8 \
+ "-DVERSION=$version" \
+ "-DAPPEXE=$(cygpath -w "$PWD/$work/lowquery.exe")" \
+ "-DOUTFILE=$(cygpath -w "$PWD/$setup")" \
+ "$(cygpath -w "$PWD/packaging/windows/installer.nsi")"
+
+portable="$work/portable"
+mkdir -p "$portable"
+cp "$work/lowquery.exe" "$portable/LowQuery.exe"
+cp README.md LICENSE "$portable/"
+zip="$RELEASE_DIR/LowQuery-$version-windows-x64-portable.zip"
+rm -f "$zip"
+powershell.exe -NoProfile -NonInteractive -Command \
+ "Compress-Archive -Path '$(cygpath -w "$PWD/$portable")\\*' -DestinationPath '$(cygpath -w "$PWD/$zip")'"
+
+ls -l "$RELEASE_DIR"
diff --git a/packaging/windows/info.json b/packaging/windows/info.json
new file mode 100644
index 0000000..d279159
--- /dev/null
+++ b/packaging/windows/info.json
@@ -0,0 +1,18 @@
+{
+ "fixed": {
+ "file_version": "@VERSION@",
+ "product_version": "@VERSION@"
+ },
+ "info": {
+ "0409": {
+ "CompanyName": "LowBloat",
+ "FileDescription": "LowQuery",
+ "FileVersion": "@VERSION@",
+ "InternalName": "lowquery",
+ "LegalCopyright": "Copyright © 2026 LowBloat. Licensed under AGPL-3.0-only.",
+ "OriginalFilename": "lowquery.exe",
+ "ProductName": "LowQuery",
+ "ProductVersion": "@VERSION@"
+ }
+ }
+}
diff --git a/packaging/windows/installer.nsi b/packaging/windows/installer.nsi
new file mode 100644
index 0000000..1d594c3
--- /dev/null
+++ b/packaging/windows/installer.nsi
@@ -0,0 +1,507 @@
+; LowQuery setup for Windows (packaging/windows/build.sh builds it).
+;
+; Installs over a Tauri build of LowQuery (0.5.x) in place, so those copies
+; update to this one through their own updater. It keeps the Tauri layout:
+; - per-user install in %LOCALAPPDATA%\LowQuery, no administrator rights;
+; - lowquery.exe and uninstall.exe;
+; - HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\LowQuery with the
+; same values, and HKCU\Software\LowBloat\LowQuery = install folder;
+; - Start Menu shortcut LowQuery.lnk (AppUserModelID dev.lowbloat.lowquery).
+; Modelled on Tauri's NSIS template (tauri-cli 2.12.3), without its plugin.
+;
+; Command line:
+; /S silent
+; /P passive: progress only, no questions, closes itself
+; /UPDATE an update: leaves the user's shortcuts as they are
+; /NS no shortcuts
+; /R start LowQuery when done (with /S or /P), with what follows /ARGS
+; /D= install folder (last argument)
+; The Tauri updater runs the setup with "/P /UPDATE /R /ARGS ".
+;
+; Defined by the build: VERSION (X.Y.Z), APPEXE (the built lowquery.exe) and
+; OUTFILE (the setup to write).
+
+Unicode true
+ManifestDPIAware true
+ManifestDPIAwareness PerMonitorV2
+SetCompressor /SOLID lzma
+
+!ifndef VERSION
+ !error "Build with -DVERSION=X.Y.Z -DAPPEXE= -DOUTFILE="
+!endif
+!ifndef APPEXE
+ !error "Build with -DAPPEXE="
+!endif
+!ifndef OUTFILE
+ !error "Build with -DOUTFILE="
+!endif
+
+!include MUI2.nsh
+!include FileFunc.nsh
+!include LogicLib.nsh
+!include WordFunc.nsh
+!include x64.nsh
+!include "Win\COM.nsh"
+!include "Win\Propkey.nsh"
+!include "Win\RestartManager.nsh"
+
+!define PRODUCTNAME "LowQuery"
+!define MANUFACTURER "LowBloat"
+!define MAINBINARYNAME "lowquery"
+!define BUNDLEID "dev.lowbloat.lowquery"
+!define COPYRIGHT "Copyright © 2026 LowBloat. Licensed under AGPL-3.0-only."
+!define UNINSTKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}"
+!define MANUKEY "Software\${MANUFACTURER}"
+!define MANUPRODUCTKEY "${MANUKEY}\${PRODUCTNAME}"
+!define WEBVIEW2APPGUID "{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}"
+!define WEBVIEW2BOOTSTRAPPERURL "https://go.microsoft.com/fwlink/p/?LinkId=2124703"
+!define /ifndef ERROR_MORE_DATA 234
+!define /ifndef MAX_PATH 260
+!define /ifndef SLGP_RAWPATH 0x4
+
+Var PassiveMode
+Var UpdateMode
+Var NoShortcutMode
+Var MsiMode
+Var MsiProductCode
+
+Name "${PRODUCTNAME}"
+BrandingText "${COPYRIGHT}"
+OutFile "${OUTFILE}"
+RequestExecutionLevel user
+
+; Only a marker: .onInit sets the real folder, keeping the previous one.
+!define PLACEHOLDER_INSTALL_DIR "placeholder\${PRODUCTNAME}"
+InstallDir "${PLACEHOLDER_INSTALL_DIR}"
+
+VIProductVersion "${VERSION}.0"
+VIAddVersionKey "ProductName" "${PRODUCTNAME}"
+VIAddVersionKey "CompanyName" "${MANUFACTURER}"
+VIAddVersionKey "FileDescription" "${PRODUCTNAME}"
+VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
+VIAddVersionKey "FileVersion" "${VERSION}"
+VIAddVersionKey "ProductVersion" "${VERSION}"
+
+!define MUI_ICON "${__FILEDIR__}\..\icons\icon.ico"
+!define MUI_UNICON "${__FILEDIR__}\..\icons\icon.ico"
+
+; Installer pages. Passive mode shows only the progress page.
+!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
+!insertmacro MUI_PAGE_WELCOME
+!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+!define MUI_FINISHPAGE_NOAUTOCLOSE
+; The "show readme" checkbox creates the desktop shortcut, as in Tauri's setup.
+!define MUI_FINISHPAGE_SHOWREADME
+!define MUI_FINISHPAGE_SHOWREADME_TEXT "$(createDesktop)"
+!define MUI_FINISHPAGE_SHOWREADME_FUNCTION CreateDesktopShortcut
+!define MUI_FINISHPAGE_RUN
+!define MUI_FINISHPAGE_RUN_FUNCTION RunMainBinary
+!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
+!insertmacro MUI_PAGE_FINISH
+
+; Uninstaller pages.
+!define MUI_PAGE_CUSTOMFUNCTION_PRE un.SkipIfPassive
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE "English"
+
+LangString createDesktop ${LANG_ENGLISH} "Create desktop shortcut"
+LangString appRunning ${LANG_ENGLISH} "${PRODUCTNAME} is running. Close it first, then try again."
+LangString appRunningOkKill ${LANG_ENGLISH} "${PRODUCTNAME} is running.$\nClick OK to close it."
+LangString failedToKillApp ${LANG_ENGLISH} "Could not close ${PRODUCTNAME}. Close it and try again."
+LangString webview2Downloading ${LANG_ENGLISH} "Downloading the WebView2 runtime..."
+LangString webview2Installing ${LANG_ENGLISH} "Installing the WebView2 runtime..."
+LangString webview2Installed ${LANG_ENGLISH} "WebView2 runtime installed."
+LangString webview2Failed ${LANG_ENGLISH} "Could not install the WebView2 runtime, which ${PRODUCTNAME} needs. Check the internet connection and try again."
+LangString msiRemoving ${LANG_ENGLISH} "Removing the copy of ${PRODUCTNAME} installed for all users..."
+LangString msiFailed ${LANG_ENGLISH} "Could not remove the copy of ${PRODUCTNAME} installed for all users (MSI). Remove it in Settings > Apps, then run this setup again."
+
+; Ends the installation with an error. A silent install writes the message
+; to the console it was started from, if any.
+!macro FailInstall message
+ ${If} ${Silent}
+ System::Call 'kernel32::AttachConsole(i -1)i.r0'
+ ${If} $0 <> 0
+ System::Call 'kernel32::GetStdHandle(i -11)i.r0'
+ FileWrite $0 "${message}$\r$\n"
+ ${EndIf}
+ ${EndIf}
+ Abort "${message}"
+!macroend
+
+; Waits a few seconds for running copies of $INSTDIR\lowquery.exe to exit (the
+; Tauri updater quits right after starting the setup), then closes them with
+; the Restart Manager. Interactive installs ask first. From Tauri's
+; CheckIfAppIsRunning, with the wait added.
+!macro CloseRunningApp
+ !define UniqueID ${__LINE__}
+ !insertmacro RestartManager_StartSession $R0
+ ${If} $R0 != ""
+ !insertmacro RestartManager_RegisterFile $R0 "$INSTDIR\${MAINBINARYNAME}.exe"
+ ${If} $0 = 0
+ StrCpy $R5 0
+ wait_${UniqueID}:
+ ; ERROR_MORE_DATA: some process still has the file open.
+ System::Call 'RSTRTMGR::RmGetList(p R0, *i .r1, *i .r2, p 0, *i .r3) i .r0'
+ ${If} $0 = ${ERROR_MORE_DATA}
+ ${AndIf} $R5 < 20
+ Sleep 250
+ IntOp $R5 $R5 + 1
+ Goto wait_${UniqueID}
+ ${EndIf}
+ ${If} $0 = ${ERROR_MORE_DATA}
+ IfSilent kill_${UniqueID}
+ ${If} $PassiveMode <> 1
+ MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(appRunningOkKill)" IDOK kill_${UniqueID}
+ !insertmacro RestartManager_EndSession $R0
+ Abort "$(appRunning)"
+ ${EndIf}
+ kill_${UniqueID}:
+ DetailPrint "Closing ${PRODUCTNAME}..."
+ System::Call 'RSTRTMGR::RmShutdown(p R0, i ${RmForceShutdown}, p 0) i .r0'
+ ${If} $0 <> 0
+ !insertmacro RestartManager_EndSession $R0
+ !insertmacro FailInstall "$(failedToKillApp)"
+ ${EndIf}
+ Sleep 500
+ ${EndIf}
+ ${EndIf}
+ !insertmacro RestartManager_EndSession $R0
+ ${EndIf}
+ !undef UniqueID
+!macroend
+
+; Shortcut helpers, from Tauri's utils.nsh.
+
+; Sets the AppUserModelID on a shortcut, so pinned and running copies group.
+!macro SetLnkAppUserModelId shortcut
+ !insertmacro ComHlpr_CreateInProcInstance ${CLSID_ShellLink} ${IID_IShellLink} r0 ""
+ ${If} $0 P<> 0
+ ${IUnknown::QueryInterface} $0 '("${IID_IPersistFile}",.r1)'
+ ${If} $1 P<> 0
+ ${IPersistFile::Load} $1 '("${shortcut}", ${STGM_READWRITE})'
+ ${IUnknown::QueryInterface} $0 '("${IID_IPropertyStore}",.r2)'
+ ${If} $2 P<> 0
+ System::Call 'Oleaut32::SysAllocString(w "${BUNDLEID}") i.r3'
+ System::Call '*${SYSSTRUCT_PROPERTYKEY}(${PKEY_AppUserModel_ID})p.r4'
+ System::Call '*${SYSSTRUCT_PROPVARIANT}(${VT_BSTR},,&i4 $3)p.r5'
+ ${IPropertyStore::SetValue} $2 '($4,$5)'
+ System::Call 'Oleaut32::SysFreeString($3)'
+ System::Free $4
+ System::Free $5
+ ${IPropertyStore::Commit} $2 ""
+ ${IUnknown::Release} $2 ""
+ ${IPersistFile::Save} $1 '("${shortcut}",1)'
+ ${EndIf}
+ ${IUnknown::Release} $1 ""
+ ${EndIf}
+ ${IUnknown::Release} $0 ""
+ ${EndIf}
+!macroend
+
+; Removes the app's jump list entries and recent destinations.
+!macro DeleteAppUserModelId
+ !insertmacro ComHlpr_CreateInProcInstance ${CLSID_DestinationList} ${IID_ICustomDestinationList} r1 ""
+ ${If} $1 P<> 0
+ ${ICustomDestinationList::DeleteList} $1 '("${BUNDLEID}")'
+ ${IUnknown::Release} $1 ""
+ ${EndIf}
+ !insertmacro ComHlpr_CreateInProcInstance ${CLSID_ApplicationDestinations} ${IID_IApplicationDestinations} r1 ""
+ ${If} $1 P<> 0
+ ${IApplicationDestinations::SetAppID} $1 '("${BUNDLEID}")i.r0'
+ ${If} $0 >= 0
+ ${IApplicationDestinations::RemoveAllDestinations} $1 ''
+ ${EndIf}
+ ${IUnknown::Release} $1 ""
+ ${EndIf}
+!macroend
+
+; Unpins a shortcut from Start and the taskbar.
+!macro UnpinShortcut shortcut
+ !insertmacro ComHlpr_CreateInProcInstance ${CLSID_StartMenuPin} ${IID_IStartMenuPinnedList} r0 ""
+ ${If} $0 P<> 0
+ System::Call 'SHELL32::SHCreateItemFromParsingName(ws, p0, g "${IID_IShellItem}", *p0r1)' "${shortcut}"
+ ${If} $1 P<> 0
+ ${IStartMenuPinnedList::RemoveFromList} $0 '(r1)'
+ ${IUnknown::Release} $1 ""
+ ${EndIf}
+ ${IUnknown::Release} $0 ""
+ ${EndIf}
+!macroend
+
+; Pushes 1 when the shortcut opens target, 0 otherwise. Changes $0 to $3.
+!macro IsShortcutTarget shortcut target
+ StrCpy $3 0
+ !insertmacro ComHlpr_CreateInProcInstance ${CLSID_ShellLink} ${IID_IShellLink} r0 ""
+ ${If} $0 P<> 0
+ ${IUnknown::QueryInterface} $0 '("${IID_IPersistFile}", .r1)'
+ ${If} $1 P<> 0
+ ${IPersistFile::Load} $1 '("${shortcut}", ${STGM_READ})'
+ System::Alloc MAX_PATH
+ Pop $2
+ ${IShellLink::GetPath} $0 '(.r2, ${MAX_PATH}, 0, ${SLGP_RAWPATH})'
+ ${If} $2 == "${target}"
+ StrCpy $3 1
+ ${EndIf}
+ System::Free $2
+ ${IUnknown::Release} $1 ""
+ ${EndIf}
+ ${IUnknown::Release} $0 ""
+ ${EndIf}
+ Push $3
+!macroend
+
+; Deletes a shortcut, and its pins, when it opens this install.
+!macro DeleteShortcutIfOurs shortcut
+ !insertmacro IsShortcutTarget "${shortcut}" "$INSTDIR\${MAINBINARYNAME}.exe"
+ Pop $0
+ ${If} $0 = 1
+ !insertmacro UnpinShortcut "${shortcut}"
+ Delete "${shortcut}"
+ ${EndIf}
+!macroend
+
+!macro ParseOptions
+ ${GetOptions} $CMDLINE "/P" $PassiveMode
+ ${IfNot} ${Errors}
+ StrCpy $PassiveMode 1
+ ${EndIf}
+ ${GetOptions} $CMDLINE "/UPDATE" $UpdateMode
+ ${IfNot} ${Errors}
+ StrCpy $UpdateMode 1
+ ${EndIf}
+ ${GetOptions} $CMDLINE "/NS" $NoShortcutMode
+ ${IfNot} ${Errors}
+ StrCpy $NoShortcutMode 1
+ ${EndIf}
+!macroend
+
+!macro SetContext
+ SetShellVarContext current
+ ${If} ${RunningX64}
+ SetRegView 64
+ ${EndIf}
+!macroend
+
+Function .onInit
+ !insertmacro ParseOptions
+ !insertmacro SetContext
+ ${If} $INSTDIR == "${PLACEHOLDER_INSTALL_DIR}"
+ StrCpy $INSTDIR "$LOCALAPPDATA\${PRODUCTNAME}"
+ ; Where the previous setup (Tauri's or this one) installed.
+ ReadRegStr $4 HKCU "${MANUPRODUCTKEY}" ""
+ ${If} $4 != ""
+ StrCpy $INSTDIR $4
+ ${EndIf}
+ ${EndIf}
+FunctionEnd
+
+Section "-WebView2"
+ ; Installed if the registry lists any version, per machine or per user.
+ ReadRegStr $4 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\${WEBVIEW2APPGUID}" "pv"
+ ${If} $4 == ""
+ ${OrIf} $4 == "0.0.0.0"
+ ReadRegStr $4 HKLM "SOFTWARE\Microsoft\EdgeUpdate\Clients\${WEBVIEW2APPGUID}" "pv"
+ ${EndIf}
+ ${If} $4 == ""
+ ${OrIf} $4 == "0.0.0.0"
+ ReadRegStr $4 HKCU "SOFTWARE\Microsoft\EdgeUpdate\Clients\${WEBVIEW2APPGUID}" "pv"
+ ${EndIf}
+ ; An update comes from a running copy, which had the runtime.
+ ${If} $4 == ""
+ ${OrIf} $4 == "0.0.0.0"
+ ${If} $UpdateMode <> 1
+ ; Microsoft's bootstrapper, downloaded as in Tauri's default
+ ; (downloadBootstrapper), with curl.exe (Windows 10 1803+) or PowerShell.
+ StrCpy $6 "$TEMP\MicrosoftEdgeWebview2Setup.exe"
+ Delete $6
+ DetailPrint "$(webview2Downloading)"
+ nsExec::ExecToLog '"$SYSDIR\curl.exe" --fail --silent --show-error --location --output "$6" "${WEBVIEW2BOOTSTRAPPERURL}"'
+ Pop $0
+ ${IfNot} ${FileExists} $6
+ ${WordReplace} $6 "'" "''" "+" $7
+ nsExec::ExecToLog `"$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -UseBasicParsing -Uri '${WEBVIEW2BOOTSTRAPPERURL}' -OutFile '$7'"`
+ Pop $0
+ ${EndIf}
+ ${IfNot} ${FileExists} $6
+ !insertmacro FailInstall "$(webview2Failed)"
+ ${EndIf}
+ DetailPrint "$(webview2Installing)"
+ ExecWait '"$6" /silent /install' $1
+ Delete $6
+ ${If} $1 = 0
+ DetailPrint "$(webview2Installed)"
+ ${Else}
+ !insertmacro FailInstall "$(webview2Failed)"
+ ${EndIf}
+ ${EndIf}
+ ${EndIf}
+SectionEnd
+
+Section "-RemoveMsiInstall"
+ ; LowQuery 0.5.x also shipped an MSI that installs for all users. Its
+ ; updater falls back to this setup, which removes that copy (Windows asks
+ ; for administrator rights) and installs per user instead, as Tauri's
+ ; setup did.
+ StrCpy $0 0
+ ${Do}
+ EnumRegKey $1 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $0
+ ${If} $1 == ""
+ ${Break}
+ ${EndIf}
+ IntOp $0 $0 + 1
+ ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1" "DisplayName"
+ ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1" "Publisher"
+ ReadRegDWORD $R2 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1" "WindowsInstaller"
+ ${If} "$R0|$R1" == "${PRODUCTNAME}|${MANUFACTURER}"
+ ${AndIf} $R2 = 1
+ StrCpy $MsiMode 1
+ StrCpy $MsiProductCode $1
+ ${Break}
+ ${EndIf}
+ ${Loop}
+
+ ${If} $MsiMode = 1
+ DetailPrint "$(msiRemoving)"
+ StrCpy $R1 '"$SYSDIR\msiexec.exe" /x $MsiProductCode /norestart'
+ ${If} $PassiveMode = 1
+ ${OrIf} ${Silent}
+ StrCpy $R1 "$R1 /passive"
+ ${EndIf}
+ ClearErrors
+ ExecWait $R1 $0
+ ${IfThen} ${Errors} ${|} StrCpy $0 1 ${|}
+ ; 3010: removed, a restart finishes the job.
+ ${If} $0 <> 0
+ ${AndIf} $0 <> 3010
+ !insertmacro FailInstall "$(msiFailed)"
+ ${EndIf}
+ ${EndIf}
+SectionEnd
+
+Section "-Install"
+ SetOutPath $INSTDIR
+ !insertmacro CloseRunningApp
+
+ File "/oname=${MAINBINARYNAME}.exe" "${APPEXE}"
+ WriteUninstaller "$INSTDIR\uninstall.exe"
+
+ ; Where to install next time.
+ WriteRegStr HKCU "${MANUPRODUCTKEY}" "" $INSTDIR
+
+ ; A previous main binary with another name goes away.
+ ReadRegStr $R0 HKCU "${UNINSTKEY}" "MainBinaryName"
+ ${If} $R0 != ""
+ ${AndIf} $R0 != "${MAINBINARYNAME}.exe"
+ Delete "$INSTDIR\$R0"
+ ${EndIf}
+
+ ; Apps & features entry, value for value as Tauri's setup writes it.
+ WriteRegStr HKCU "${UNINSTKEY}" "MainBinaryName" "${MAINBINARYNAME}.exe"
+ WriteRegStr HKCU "${UNINSTKEY}" "DisplayName" "${PRODUCTNAME}"
+ WriteRegStr HKCU "${UNINSTKEY}" "DisplayIcon" "$\"$INSTDIR\${MAINBINARYNAME}.exe$\""
+ WriteRegStr HKCU "${UNINSTKEY}" "DisplayVersion" "${VERSION}"
+ WriteRegStr HKCU "${UNINSTKEY}" "Publisher" "${MANUFACTURER}"
+ WriteRegStr HKCU "${UNINSTKEY}" "InstallLocation" "$\"$INSTDIR$\""
+ WriteRegStr HKCU "${UNINSTKEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
+ WriteRegDWORD HKCU "${UNINSTKEY}" "NoModify" "1"
+ WriteRegDWORD HKCU "${UNINSTKEY}" "NoRepair" "1"
+ ${GetSize} "$INSTDIR" "/S=0K /G=0" $0 $1 $2
+ IntFmt $0 "0x%08X" $0
+ WriteRegDWORD HKCU "${UNINSTKEY}" "EstimatedSize" "$0"
+
+ Call CreateStartMenuShortcut
+ ; The finish page, which offers the desktop shortcut, is skipped.
+ ${If} $PassiveMode = 1
+ ${OrIf} ${Silent}
+ Call CreateDesktopShortcut
+ ${EndIf}
+
+ ${If} $PassiveMode = 1
+ SetAutoClose true
+ ${EndIf}
+SectionEnd
+
+Function .onInstSuccess
+ ; /R only applies without the finish page, which has its own checkbox.
+ ${If} $PassiveMode = 1
+ ${OrIf} ${Silent}
+ ${GetOptions} $CMDLINE "/R" $R0
+ ${IfNot} ${Errors}
+ ${GetOptions} $CMDLINE "/ARGS" $R0
+ Exec '"$INSTDIR\${MAINBINARYNAME}.exe" $R0'
+ ${EndIf}
+ ${EndIf}
+FunctionEnd
+
+Function RunMainBinary
+ Exec '"$INSTDIR\${MAINBINARYNAME}.exe"'
+FunctionEnd
+
+; Updates keep the user's shortcuts, deleted ones included; they open the
+; same path. Replacing the MSI copy, whose uninstaller removed its shortcuts,
+; creates them.
+Function CreateStartMenuShortcut
+ ${If} $MsiMode <> 1
+ ${If} $UpdateMode = 1
+ ${OrIf} $NoShortcutMode = 1
+ Return
+ ${EndIf}
+ ${EndIf}
+ CreateShortcut "$SMPROGRAMS\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
+ !insertmacro SetLnkAppUserModelId "$SMPROGRAMS\${PRODUCTNAME}.lnk"
+FunctionEnd
+
+Function CreateDesktopShortcut
+ ${If} $MsiMode <> 1
+ ${If} $UpdateMode = 1
+ ${OrIf} $NoShortcutMode = 1
+ Return
+ ${EndIf}
+ ${EndIf}
+ CreateShortcut "$DESKTOP\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
+ !insertmacro SetLnkAppUserModelId "$DESKTOP\${PRODUCTNAME}.lnk"
+FunctionEnd
+
+Function SkipIfPassive
+ ${IfThen} $PassiveMode = 1 ${|} Abort ${|}
+FunctionEnd
+
+Function un.SkipIfPassive
+ ${IfThen} $PassiveMode = 1 ${|} Abort ${|}
+FunctionEnd
+
+Function un.onInit
+ !insertmacro ParseOptions
+ !insertmacro SetContext
+FunctionEnd
+
+; Removes the program, its shortcuts and its registry entries. Connections,
+; settings and the webview profile stay: they live outside the install folder
+; (%APPDATA%\LowBloat, %LOCALAPPDATA%\LowBloat and Tauri's dev.lowbloat.lowquery).
+Section Uninstall
+ !insertmacro CloseRunningApp
+
+ Delete "$INSTDIR\${MAINBINARYNAME}.exe"
+ Delete "$INSTDIR\uninstall.exe"
+ RMDir "$INSTDIR"
+
+ ${If} $UpdateMode <> 1
+ !insertmacro DeleteAppUserModelId
+ !insertmacro DeleteShortcutIfOurs "$SMPROGRAMS\${PRODUCTNAME}.lnk"
+ !insertmacro DeleteShortcutIfOurs "$DESKTOP\${PRODUCTNAME}.lnk"
+ ; Start at login, if the app was set to.
+ DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "${PRODUCTNAME}"
+ DeleteRegKey HKCU "${MANUPRODUCTKEY}"
+ DeleteRegKey /ifempty HKCU "${MANUKEY}"
+ ${EndIf}
+ DeleteRegKey HKCU "${UNINSTKEY}"
+
+ ${If} $PassiveMode = 1
+ ${OrIf} $UpdateMode = 1
+ SetAutoClose true
+ ${EndIf}
+SectionEnd
diff --git a/packaging/windows/lowquery.exe.manifest b/packaging/windows/lowquery.exe.manifest
new file mode 100644
index 0000000..7edc63e
--- /dev/null
+++ b/packaging/windows/lowquery.exe.manifest
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true/pm
+ permonitorv2,permonitor
+
+
+
+
+
+
+
+
+
+
diff --git a/scripts/check-version.mjs b/scripts/check-version.mjs
index ac65fd1..46e20e4 100644
--- a/scripts/check-version.mjs
+++ b/scripts/check-version.mjs
@@ -1,30 +1,26 @@
// Usage: bun scripts/check-version.mjs [vX.Y.Z]
-// Fails when the version-bearing files disagree, or differ from the given tag.
+// The app version lives in package.json (main.go embeds it; the packaging
+// scripts read it). Fails when it is not X.Y.Z or when it differs from the
+// given tag.
import { appendFileSync, readFileSync } from "node:fs";
-const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), "utf8");
+const path = (file) => new URL(`../${file}`, import.meta.url);
+const read = (file) => readFileSync(path(file), "utf8");
-const versions = [
- { path: "package.json", version: JSON.parse(read("package.json")).version },
- { path: "src-tauri/tauri.conf.json", version: JSON.parse(read("src-tauri/tauri.conf.json")).version },
- {
- path: "src-tauri/Cargo.toml",
- version: /^\[package\][\s\S]*?^version\s*=\s*"([^"]+)"/m.exec(read("src-tauri/Cargo.toml"))?.[1],
- },
-];
+const versions = [{ file: "package.json", version: JSON.parse(read("package.json")).version }];
+for (const { file, version } of versions) console.log(`${String(version).padEnd(10)} ${file}`);
-for (const { path, version } of versions) console.log(`${String(version).padEnd(10)} ${path}`);
-
-const distinct = [...new Set(versions.map((v) => v.version))];
-if (distinct.length !== 1 || !distinct[0]) {
- console.error("Version files disagree. Update package.json, src-tauri/tauri.conf.json and src-tauri/Cargo.toml together.");
+const version = versions[0].version;
+// The Windows setup and the release tags need a plain X.Y.Z.
+if (!/^\d+\.\d+\.\d+$/.test(String(version))) {
+ console.error(`package.json version ${version} is not X.Y.Z.`);
process.exit(1);
}
const tag = process.argv[2];
-if (tag && tag !== `v${distinct[0]}`) {
- console.error(`Tag ${tag} does not match version ${distinct[0]}.`);
+if (tag && tag !== `v${version}`) {
+ console.error(`Tag ${tag} does not match version ${version}.`);
process.exit(1);
}
-if (process.env.GITHUB_OUTPUT) appendFileSync(process.env.GITHUB_OUTPUT, `version=${distinct[0]}\n`);
+if (process.env.GITHUB_OUTPUT) appendFileSync(process.env.GITHUB_OUTPUT, `version=${version}\n`);
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
deleted file mode 100644
index 0b99236..0000000
--- a/src-tauri/Cargo.lock
+++ /dev/null
@@ -1,7050 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 4
-
-[[package]]
-name = "adler2"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
-
-[[package]]
-name = "aead"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1973cfbc1a2daf9cf550e74e1f088c28e7f7d8c1e1418fb6c9dc5184b7e84c99"
-dependencies = [
- "crypto-common 0.2.2",
- "inout",
-]
-
-[[package]]
-name = "aes"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35f0f96ce78e38c3dc6d8948aa8163d06385be74000f3c7a95bf1eef35d3ea32"
-dependencies = [
- "cipher",
- "cpubits",
- "cpufeatures 0.3.1",
-]
-
-[[package]]
-name = "aes-gcm"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f2b8006a0c83f52b62ba44a97b58bf76fe2f70a329e588f67f89691d93d498f"
-dependencies = [
- "aead",
- "aes",
- "cipher",
- "ctr",
- "ctutils",
- "ghash",
-]
-
-[[package]]
-name = "aho-corasick"
-version = "1.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "alloc-no-stdlib"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2fb6cfd47bf496ff64095c20eaba0c201404ee38714d4142fcfa1dc334fcc7a"
-
-[[package]]
-name = "alloc-stdlib"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b5c1865780388bfa186411ab5f247819487fc4864c6e9c3106611fa347586e1"
-dependencies = [
- "alloc-no-stdlib",
-]
-
-[[package]]
-name = "allocator-api2"
-version = "0.2.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
-
-[[package]]
-name = "android_system_properties"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "anyhow"
-version = "1.0.104"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
-
-[[package]]
-name = "arc-swap"
-version = "1.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "380962b3d93b99642e50b9febf72c071e97e8b32d86eae9cf4ef582bb960ae6e"
-dependencies = [
- "rustversion",
-]
-
-[[package]]
-name = "arcstr"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03918c3dbd7701a85c6b9887732e2921175f26c350b4563841d0958c21d57e6d"
-
-[[package]]
-name = "async-broadcast"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
-dependencies = [
- "event-listener",
- "event-listener-strategy",
- "futures-core",
- "pin-project-lite",
-]
-
-[[package]]
-name = "async-channel"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
-dependencies = [
- "concurrent-queue",
- "event-listener-strategy",
- "futures-core",
- "pin-project-lite",
-]
-
-[[package]]
-name = "async-executor"
-version = "1.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a"
-dependencies = [
- "async-task",
- "concurrent-queue",
- "fastrand",
- "futures-lite",
- "pin-project-lite",
- "slab",
-]
-
-[[package]]
-name = "async-io"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"
-dependencies = [
- "autocfg",
- "cfg-if",
- "concurrent-queue",
- "futures-io",
- "futures-lite",
- "parking",
- "polling",
- "rustix",
- "slab",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "async-lock"
-version = "3.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
-dependencies = [
- "event-listener",
- "event-listener-strategy",
- "pin-project-lite",
-]
-
-[[package]]
-name = "async-process"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
-dependencies = [
- "async-channel",
- "async-io",
- "async-lock",
- "async-signal",
- "async-task",
- "blocking",
- "cfg-if",
- "event-listener",
- "futures-lite",
- "rustix",
-]
-
-[[package]]
-name = "async-recursion"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "async-signal"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"
-dependencies = [
- "async-io",
- "async-lock",
- "atomic-waker",
- "cfg-if",
- "futures-core",
- "futures-io",
- "rustix",
- "signal-hook-registry",
- "slab",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "async-task"
-version = "4.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
-
-[[package]]
-name = "async-trait"
-version = "0.1.92"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "asynchronous-codec"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233"
-dependencies = [
- "bytes",
- "futures-sink",
- "futures-util",
- "memchr",
- "pin-project-lite",
-]
-
-[[package]]
-name = "atk"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b"
-dependencies = [
- "atk-sys",
- "glib",
- "libc",
-]
-
-[[package]]
-name = "atk-sys"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086"
-dependencies = [
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps",
-]
-
-[[package]]
-name = "atomic-waker"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
-
-[[package]]
-name = "autocfg"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
-
-[[package]]
-name = "aws-lc-rs"
-version = "1.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "faac5829c2b74c28f830747e7818ccfb684261b5f48a1118b1e2a13d36dfab13"
-dependencies = [
- "aws-lc-sys",
- "zeroize",
-]
-
-[[package]]
-name = "aws-lc-sys"
-version = "0.46.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1622d8446a2d4b2ce0c7eefc73dd43a99779028d5ee5c2dd8073a658ba8a2bc"
-dependencies = [
- "cc",
- "cmake",
- "dunce",
- "fs_extra",
- "pkg-config",
-]
-
-[[package]]
-name = "base16ct"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd307490d624467aa6f74b0eabb77633d1f758a7b25f12bceb0b22e08d9726f6"
-
-[[package]]
-name = "base64"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"
-dependencies = [
- "byteorder",
-]
-
-[[package]]
-name = "base64"
-version = "0.21.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
-
-[[package]]
-name = "base64"
-version = "0.22.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
-
-[[package]]
-name = "base64"
-version = "0.23.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"
-
-[[package]]
-name = "base64ct"
-version = "1.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
-
-[[package]]
-name = "bit-set"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
-dependencies = [
- "bit-vec",
-]
-
-[[package]]
-name = "bit-vec"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "bitflags"
-version = "2.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"
-dependencies = [
- "hybrid-array",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "710f1dd022ef4e93f8a438b4ba958de7f64308434fa6a87104481645cc30068b"
-dependencies = [
- "hybrid-array",
-]
-
-[[package]]
-name = "block2"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5"
-dependencies = [
- "objc2",
-]
-
-[[package]]
-name = "blocking"
-version = "1.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a70e4329df6cb94385eed412ec92375c3cdd8a6e502493d1229b6414e4036dfa"
-dependencies = [
- "async-channel",
- "async-task",
- "futures-io",
- "futures-lite",
- "piper",
-]
-
-[[package]]
-name = "brotli"
-version = "9.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8b851b75c23ca7873623d612fe49bd1989aeb03d08fb9432187eb253d3d4c6b"
-dependencies = [
- "alloc-no-stdlib",
- "alloc-stdlib",
- "brotli-decompressor",
-]
-
-[[package]]
-name = "brotli-decompressor"
-version = "6.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "941cd9bd4ddab83cb46fa5a2d428f1c857b24ac78cb876cf7beb710840934bd7"
-dependencies = [
- "alloc-no-stdlib",
- "alloc-stdlib",
-]
-
-[[package]]
-name = "bs58"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4"
-dependencies = [
- "tinyvec",
-]
-
-[[package]]
-name = "btoi"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b5ab9db53bcda568284df0fd39f6eac24ad6f7ba7ff1168b9e76eba6576b976"
-dependencies = [
- "num-traits",
-]
-
-[[package]]
-name = "bumpalo"
-version = "3.20.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
-
-[[package]]
-name = "bytemuck"
-version = "1.25.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"
-
-[[package]]
-name = "byteorder"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
-
-[[package]]
-name = "bytes"
-version = "1.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "cairo-rs"
-version = "0.18.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2"
-dependencies = [
- "bitflags 2.13.2",
- "cairo-sys-rs",
- "glib",
- "libc",
- "once_cell",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "cairo-sys-rs"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51"
-dependencies = [
- "glib-sys",
- "libc",
- "system-deps",
-]
-
-[[package]]
-name = "camino"
-version = "1.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbbad30e4b4c14a39e3cc8aed085a12a327257c316619c93581e017bc52be591"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "cargo-platform"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "cargo_metadata"
-version = "0.19.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba"
-dependencies = [
- "camino",
- "cargo-platform",
- "semver",
- "serde",
- "serde_json",
- "thiserror 2.0.21",
-]
-
-[[package]]
-name = "cargo_toml"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "82f4b26e751e711a5302649417f2da046dce6391b2ea30a4820f37462314f0b9"
-dependencies = [
- "semver",
- "serde",
- "toml 1.1.8+spec-1.1.0",
-]
-
-[[package]]
-name = "cbc"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce2dc9ee5f88d11e0beb842c88b33c8a5cf0d1329c4b19494af42b07dbfe8896"
-dependencies = [
- "cipher",
-]
-
-[[package]]
-name = "cc"
-version = "1.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "877bf67ac8e52449eb2f9e98a344ea163beb70dd1f9eebe3cc5357dcfeaee4df"
-dependencies = [
- "find-msvc-tools",
- "jobserver",
- "libc",
- "shlex",
-]
-
-[[package]]
-name = "cesu8"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
-
-[[package]]
-name = "cfb"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a347dcabdae9c31b0825fd6a8bed285ec9c2acb89c47827126d52fa4f59cece3"
-dependencies = [
- "fnv",
- "uuid",
- "web-time",
-]
-
-[[package]]
-name = "cfg-expr"
-version = "0.15.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02"
-dependencies = [
- "smallvec",
- "target-lexicon",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
-
-[[package]]
-name = "cfg_aliases"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"
-
-[[package]]
-name = "chacha20"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06"
-dependencies = [
- "cfg-if",
- "cpufeatures 0.3.1",
- "rand_core 0.10.1",
-]
-
-[[package]]
-name = "chrono"
-version = "0.4.45"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327"
-dependencies = [
- "iana-time-zone",
- "js-sys",
- "num-traits",
- "serde",
- "wasm-bindgen",
- "windows-link",
-]
-
-[[package]]
-name = "cipher"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8cf2a2c93cd704877c0858356ed03480ff301ee950b43f1cbe4573b088bfa6c"
-dependencies = [
- "block-buffer 0.12.1",
- "crypto-common 0.2.2",
- "inout",
-]
-
-[[package]]
-name = "cmake"
-version = "0.1.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "cmov"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a"
-
-[[package]]
-name = "combine"
-version = "4.6.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92"
-dependencies = [
- "bytes",
- "futures-core",
- "memchr",
- "pin-project-lite",
- "tokio",
- "tokio-util",
-]
-
-[[package]]
-name = "concurrent-queue"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
-dependencies = [
- "crossbeam-utils",
-]
-
-[[package]]
-name = "connection-string"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "510ca239cf13b7f8d16a2b48f263de7b4f8c566f0af58d901031473c76afb1e3"
-
-[[package]]
-name = "const-oid"
-version = "0.9.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
-
-[[package]]
-name = "const-oid"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c"
-
-[[package]]
-name = "constant_time_eq"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9eb6feb175df65d0a3ccd3e73484e940d0ac664e8034f0519fd49a93db3071d9"
-dependencies = [
- "rustversion",
-]
-
-[[package]]
-name = "cookie"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a373e3602691c3cdea496d2f0ee5935151e6168fe87739483c463db1b2f2f87"
-dependencies = [
- "time",
- "version_check",
-]
-
-[[package]]
-name = "core-foundation"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation-sys"
-version = "0.8.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
-
-[[package]]
-name = "core-graphics"
-version = "0.25.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97"
-dependencies = [
- "bitflags 2.13.2",
- "core-foundation 0.10.1",
- "core-graphics-types",
- "foreign-types",
- "libc",
-]
-
-[[package]]
-name = "core-graphics-types"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"
-dependencies = [
- "bitflags 2.13.2",
- "core-foundation 0.10.1",
- "libc",
-]
-
-[[package]]
-name = "core_detect"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48"
-
-[[package]]
-name = "cpubits"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15b85f9c39137c3a891689859392b1bd49812121d0d61c9caf00d46ed5ce06ae"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "cpufeatures"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crc32fast"
-version = "1.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01a7799fd6b852db0e61728dde9a204c423b44d689dbd432522543614b490e78"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "crossbeam-channel"
-version = "0.5.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98b0cc327b5bc766e7fda9c9260cc0fa81b43a8e240440422dff70788e3f9ef1"
-dependencies = [
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-queue"
-version = "0.3.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03e8bd762f7479489c70ed6c768ddca99d7296857de437a68dcb2a94365b3fae"
-dependencies = [
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-utils"
-version = "0.8.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
-
-[[package]]
-name = "crypto-common"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
-dependencies = [
- "generic-array",
- "typenum",
-]
-
-[[package]]
-name = "crypto-common"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
-dependencies = [
- "hybrid-array",
-]
-
-[[package]]
-name = "cssparser"
-version = "0.37.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c9cdaae01d5ed7882b04d795e7f752f46ff52d2fa3b50a20d28c464510bba98"
-dependencies = [
- "cssparser-macros",
- "dtoa-short",
- "itoa",
- "phf",
- "smallvec",
-]
-
-[[package]]
-name = "cssparser-macros"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a"
-dependencies = [
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "ctor"
-version = "1.0.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d"
-
-[[package]]
-name = "ctr"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baaca1c4b237092596f64d571e9db6ce4109c4ef9742e27590f1709594461f21"
-dependencies = [
- "cipher",
-]
-
-[[package]]
-name = "ctutils"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38d28fb6aa7dd680b3ffd1a3e64e115c177bdba63c0ae7f9cd48129ff05c4fa0"
-dependencies = [
- "cmov",
-]
-
-[[package]]
-name = "darling"
-version = "0.23.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d"
-dependencies = [
- "darling_core 0.23.0",
- "darling_macro 0.23.0",
-]
-
-[[package]]
-name = "darling"
-version = "0.24.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec"
-dependencies = [
- "darling_core 0.24.1",
- "darling_macro 0.24.1",
-]
-
-[[package]]
-name = "darling_core"
-version = "0.23.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0"
-dependencies = [
- "ident_case",
- "proc-macro2",
- "quote",
- "strsim",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "darling_core"
-version = "0.24.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff"
-dependencies = [
- "ident_case",
- "proc-macro2",
- "quote",
- "strsim",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "darling_macro"
-version = "0.23.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d"
-dependencies = [
- "darling_core 0.23.0",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "darling_macro"
-version = "0.24.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785"
-dependencies = [
- "darling_core 0.24.1",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "dashmap"
-version = "6.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6361d5c062261c78a176addb82d4c821ae42bed6089de0e12603cd25de2059c"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
- "hashbrown 0.14.5",
- "lock_api",
- "once_cell",
- "parking_lot_core",
-]
-
-[[package]]
-name = "dbus"
-version = "0.9.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ab69f03cc8c4340c9c8e315114e1658e6775a9b16a04357973aa21cec22b32e"
-dependencies = [
- "libc",
- "libdbus-sys",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "dbus-secret-service"
-version = "4.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "708b509edf7889e53d7efb0ffadd994cc6c2345ccb62f55cfd6b0682165e4fa6"
-dependencies = [
- "dbus",
- "zeroize",
-]
-
-[[package]]
-name = "defmt"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4a0795ac740cb54d7b3775c9c17345f6aaecf884c01733b39d6017738e0e3e1"
-dependencies = [
- "bitflags 1.3.2",
- "defmt-macros",
-]
-
-[[package]]
-name = "defmt-macros"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "840bb056bd99c495c9188198a258ab787c79f306d864db3e6e8451442d6d8366"
-dependencies = [
- "defmt-parser",
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "defmt-parser"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71958f69fb2de856c5dd51ac9377e986ca1aa5919f931bf5395a807277f889a0"
-dependencies = [
- "thiserror 2.0.21",
-]
-
-[[package]]
-name = "der"
-version = "0.7.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
-dependencies = [
- "const-oid 0.9.6",
- "der_derive",
- "flagset",
- "zeroize",
-]
-
-[[package]]
-name = "der"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a878c850e9e421b20262e9b41f9c860e4785fa07541c266b62ff9d1ef998a80a"
-dependencies = [
- "const-oid 0.10.2",
- "pem-rfc7468",
- "zeroize",
-]
-
-[[package]]
-name = "der_derive"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "deranged"
-version = "0.5.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "derive_more"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134"
-dependencies = [
- "derive_more-impl",
-]
-
-[[package]]
-name = "derive_more-impl"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb"
-dependencies = [
- "proc-macro2",
- "quote",
- "rustc_version",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
-dependencies = [
- "block-buffer 0.10.4",
- "crypto-common 0.1.7",
-]
-
-[[package]]
-name = "digest"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
-dependencies = [
- "block-buffer 0.12.1",
- "const-oid 0.10.2",
- "crypto-common 0.2.2",
- "ctutils",
-]
-
-[[package]]
-name = "directories"
-version = "6.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16f5094c54661b38d03bd7e50df373292118db60b585c08a411c6d840017fe7d"
-dependencies = [
- "dirs-sys",
-]
-
-[[package]]
-name = "dirs"
-version = "7.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d57d423b3c82e89b9a24ca3091fee61f456a26edbd28d26c65906f4bc1dcd8f"
-dependencies = [
- "dirs-sys",
-]
-
-[[package]]
-name = "dirs-sys"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"
-dependencies = [
- "libc",
- "option-ext",
- "redox_users",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "dispatch2"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38"
-dependencies = [
- "bitflags 2.13.2",
- "block2",
- "libc",
- "objc2",
-]
-
-[[package]]
-name = "displaydoc"
-version = "0.2.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "dlopen2"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4"
-dependencies = [
- "dlopen2_derive",
- "libc",
- "once_cell",
- "winapi",
-]
-
-[[package]]
-name = "dlopen2_derive"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "dom_query"
-version = "0.28.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fac5fca71e65e94cc718a6e2af65d6e0f9c6027751c2aa562fbb5087fda639bc"
-dependencies = [
- "bit-set",
- "cssparser",
- "foldhash",
- "html5ever",
- "precomputed-hash",
- "selectors",
- "tendril",
-]
-
-[[package]]
-name = "dpi"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "dtoa"
-version = "1.0.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590"
-
-[[package]]
-name = "dtoa-short"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87"
-dependencies = [
- "dtoa",
-]
-
-[[package]]
-name = "dunce"
-version = "1.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
-
-[[package]]
-name = "dyn-clone"
-version = "1.0.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
-
-[[package]]
-name = "either"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
-
-[[package]]
-name = "embed-resource"
-version = "3.0.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6168487b5e7eb2673e6efe1200b1848016e436a6ca0b8031bf04bd9d493a249f"
-dependencies = [
- "cc",
- "memchr",
- "rustc_version",
- "toml 1.1.8+spec-1.1.0",
- "vswhom",
- "winreg",
-]
-
-[[package]]
-name = "embed_plist"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7"
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.42"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e985e0451871ad22fb8d2b6b076e2028a502a0d3950998c2c5c0a4f9b5d9679"
-dependencies = [
- "cfg-if",
- "core_detect",
- "multiversion_no_op",
- "rustversion",
- "scopeguard",
- "simdutf8",
-]
-
-[[package]]
-name = "endi"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
-
-[[package]]
-name = "enumflags2"
-version = "0.7.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
-dependencies = [
- "enumflags2_derive",
- "serde",
-]
-
-[[package]]
-name = "enumflags2_derive"
-version = "0.7.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "equivalent"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
-
-[[package]]
-name = "erased-serde"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec"
-dependencies = [
- "serde",
- "serde_core",
- "typeid",
-]
-
-[[package]]
-name = "errno"
-version = "0.3.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
-dependencies = [
- "libc",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "event-listener"
-version = "5.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2"
-dependencies = [
- "parking",
- "pin-project-lite",
-]
-
-[[package]]
-name = "event-listener-strategy"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
-dependencies = [
- "event-listener",
- "pin-project-lite",
-]
-
-[[package]]
-name = "fallible-iterator"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7"
-
-[[package]]
-name = "fallible-iterator"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
-
-[[package]]
-name = "fallible-streaming-iterator"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
-
-[[package]]
-name = "fastrand"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
-
-[[package]]
-name = "fdeflate"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c"
-dependencies = [
- "simd-adler32",
-]
-
-[[package]]
-name = "field-offset"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f"
-dependencies = [
- "memoffset",
- "rustc_version",
-]
-
-[[package]]
-name = "filetime"
-version = "0.2.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759"
-dependencies = [
- "cfg-if",
- "libc",
-]
-
-[[package]]
-name = "find-msvc-tools"
-version = "0.1.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48"
-
-[[package]]
-name = "flagset"
-version = "0.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7ac824320a75a52197e8f2d787f6a38b6718bb6897a35142d749af3c0e8f4fe"
-
-[[package]]
-name = "flate2"
-version = "1.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb"
-dependencies = [
- "crc32fast",
- "miniz_oxide 0.9.1",
- "zlib-rs",
-]
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "foldhash"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
-
-[[package]]
-name = "foreign-types"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
-dependencies = [
- "foreign-types-macros",
- "foreign-types-shared",
-]
-
-[[package]]
-name = "foreign-types-macros"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "foreign-types-shared"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "fs_extra"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
-
-[[package]]
-name = "futures"
-version = "0.3.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-executor",
- "futures-io",
- "futures-sink",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
-dependencies = [
- "futures-core",
- "futures-sink",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
-
-[[package]]
-name = "futures-executor"
-version = "0.3.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"
-dependencies = [
- "futures-core",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-io"
-version = "0.3.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
-
-[[package]]
-name = "futures-lite"
-version = "2.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
-dependencies = [
- "fastrand",
- "futures-core",
- "futures-io",
- "parking",
- "pin-project-lite",
-]
-
-[[package]]
-name = "futures-macro"
-version = "0.3.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "futures-sink"
-version = "0.3.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
-
-[[package]]
-name = "futures-task"
-version = "0.3.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
-
-[[package]]
-name = "futures-timer"
-version = "3.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af43fadb8a98512d547e37b4e92e0ced13e205c061b87b4623eff01d918d6968"
-
-[[package]]
-name = "futures-util"
-version = "0.3.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-macro",
- "futures-sink",
- "futures-task",
- "memchr",
- "pin-project-lite",
- "slab",
-]
-
-[[package]]
-name = "gdk"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691"
-dependencies = [
- "cairo-rs",
- "gdk-pixbuf",
- "gdk-sys",
- "gio",
- "glib",
- "libc",
- "pango",
-]
-
-[[package]]
-name = "gdk-pixbuf"
-version = "0.18.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec"
-dependencies = [
- "gdk-pixbuf-sys",
- "gio",
- "glib",
- "libc",
- "once_cell",
-]
-
-[[package]]
-name = "gdk-pixbuf-sys"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7"
-dependencies = [
- "gio-sys",
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps",
-]
-
-[[package]]
-name = "gdk-sys"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7"
-dependencies = [
- "cairo-sys-rs",
- "gdk-pixbuf-sys",
- "gio-sys",
- "glib-sys",
- "gobject-sys",
- "libc",
- "pango-sys",
- "pkg-config",
- "system-deps",
-]
-
-[[package]]
-name = "gdkwayland-sys"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69"
-dependencies = [
- "gdk-sys",
- "glib-sys",
- "gobject-sys",
- "libc",
- "pkg-config",
- "system-deps",
-]
-
-[[package]]
-name = "gdkx11"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe"
-dependencies = [
- "gdk",
- "gdkx11-sys",
- "gio",
- "glib",
- "libc",
- "x11",
-]
-
-[[package]]
-name = "gdkx11-sys"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d"
-dependencies = [
- "gdk-sys",
- "glib-sys",
- "libc",
- "system-deps",
- "x11",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
-dependencies = [
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi 0.9.0+wasi-snapshot-preview1",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi 0.11.1+wasi-snapshot-preview1",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
-dependencies = [
- "cfg-if",
- "libc",
- "r-efi 5.3.0",
- "wasip2",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "r-efi 6.0.0",
- "rand_core 0.10.1",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "ghash"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2eecf2d5dc9b66b732b97707a0210906b1d30523eb773193ab777c0c84b3e8d5"
-dependencies = [
- "polyval",
-]
-
-[[package]]
-name = "gio"
-version = "0.18.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-util",
- "gio-sys",
- "glib",
- "libc",
- "once_cell",
- "pin-project-lite",
- "smallvec",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "gio-sys"
-version = "0.18.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2"
-dependencies = [
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps",
- "winapi",
-]
-
-[[package]]
-name = "glib"
-version = "0.18.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5"
-dependencies = [
- "bitflags 2.13.2",
- "futures-channel",
- "futures-core",
- "futures-executor",
- "futures-task",
- "futures-util",
- "gio-sys",
- "glib-macros",
- "glib-sys",
- "gobject-sys",
- "libc",
- "memchr",
- "once_cell",
- "smallvec",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "glib-macros"
-version = "0.18.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc"
-dependencies = [
- "heck 0.4.1",
- "proc-macro-crate 2.0.2",
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "glib-sys"
-version = "0.18.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898"
-dependencies = [
- "libc",
- "system-deps",
-]
-
-[[package]]
-name = "glob"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"
-
-[[package]]
-name = "gobject-sys"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44"
-dependencies = [
- "glib-sys",
- "libc",
- "system-deps",
-]
-
-[[package]]
-name = "gtk"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a"
-dependencies = [
- "atk",
- "cairo-rs",
- "field-offset",
- "futures-channel",
- "gdk",
- "gdk-pixbuf",
- "gio",
- "glib",
- "gtk-sys",
- "gtk3-macros",
- "libc",
- "pango",
- "pkg-config",
-]
-
-[[package]]
-name = "gtk-sys"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414"
-dependencies = [
- "atk-sys",
- "cairo-sys-rs",
- "gdk-pixbuf-sys",
- "gdk-sys",
- "gio-sys",
- "glib-sys",
- "gobject-sys",
- "libc",
- "pango-sys",
- "system-deps",
-]
-
-[[package]]
-name = "gtk3-macros"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d"
-dependencies = [
- "proc-macro-crate 1.3.1",
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
-
-[[package]]
-name = "hashbrown"
-version = "0.14.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
-
-[[package]]
-name = "hashbrown"
-version = "0.16.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
-dependencies = [
- "foldhash",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.17.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
-dependencies = [
- "allocator-api2",
- "equivalent",
- "foldhash",
-]
-
-[[package]]
-name = "hashlink"
-version = "0.12.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a596f1b20ed2cc5ecac41a164aaebc7258057060f06c0cf7a2ba3991ee7990fb"
-dependencies = [
- "hashbrown 0.17.1",
-]
-
-[[package]]
-name = "heck"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
-
-[[package]]
-name = "heck"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
-
-[[package]]
-name = "hermit-abi"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284"
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
-name = "hmac"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f"
-dependencies = [
- "digest 0.11.3",
-]
-
-[[package]]
-name = "html5ever"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46a1761807faccc9a19e86944bbf40610014066306f96edcdedc2fb714bcb7b8"
-dependencies = [
- "log",
- "markup5ever",
-]
-
-[[package]]
-name = "http"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0"
-dependencies = [
- "bytes",
- "itoa",
-]
-
-[[package]]
-name = "http-body"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c"
-dependencies = [
- "bytes",
- "http",
-]
-
-[[package]]
-name = "http-body-util"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c"
-dependencies = [
- "bytes",
- "futures-core",
- "http",
- "http-body",
- "pin-project-lite",
-]
-
-[[package]]
-name = "httparse"
-version = "1.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
-
-[[package]]
-name = "hybrid-array"
-version = "0.4.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17"
-dependencies = [
- "typenum",
-]
-
-[[package]]
-name = "hyper"
-version = "1.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c3e324da4c95177d6291d4c8730197c0d1822f8a9766814a4a44fa5ab797c9c"
-dependencies = [
- "atomic-waker",
- "bytes",
- "futures-core",
- "http",
- "http-body",
- "httparse",
- "itoa",
- "pin-project-lite",
- "smallvec",
- "tokio",
- "want",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.27.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53"
-dependencies = [
- "http",
- "hyper",
- "hyper-util",
- "rustls",
- "tokio",
- "tokio-rustls",
- "tower-service",
-]
-
-[[package]]
-name = "hyper-util"
-version = "0.1.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff"
-dependencies = [
- "base64 0.23.1",
- "bytes",
- "futures-channel",
- "futures-util",
- "http",
- "http-body",
- "httparse",
- "hyper",
- "ipnet",
- "libc",
- "percent-encoding",
- "pin-project-lite",
- "socket2",
- "system-configuration",
- "tokio",
- "tower-service",
- "tracing",
- "windows-registry",
-]
-
-[[package]]
-name = "iana-time-zone"
-version = "0.1.65"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470"
-dependencies = [
- "android_system_properties",
- "core-foundation-sys",
- "iana-time-zone-haiku",
- "js-sys",
- "log",
- "wasm-bindgen",
- "windows-core",
-]
-
-[[package]]
-name = "iana-time-zone-haiku"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "ico"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371"
-dependencies = [
- "byteorder",
- "png 0.17.16",
-]
-
-[[package]]
-name = "icu_collections"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513"
-dependencies = [
- "displaydoc",
- "potential_utf",
- "utf8_iter",
- "yoke",
- "zerofrom",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locale_core"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb"
-dependencies = [
- "displaydoc",
- "litemap",
- "tinystr",
- "writeable",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f"
-dependencies = [
- "icu_collections",
- "icu_normalizer_data",
- "icu_properties",
- "icu_provider",
- "smallvec",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer_data"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0"
-
-[[package]]
-name = "icu_properties"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148"
-dependencies = [
- "displaydoc",
- "icu_collections",
- "icu_locale_core",
- "icu_properties_data",
- "icu_provider",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "icu_properties_data"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa"
-
-[[package]]
-name = "icu_provider"
-version = "2.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73"
-dependencies = [
- "displaydoc",
- "icu_locale_core",
- "writeable",
- "yoke",
- "zerofrom",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "ident_case"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
-
-[[package]]
-name = "idna"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
-dependencies = [
- "idna_adapter",
- "smallvec",
- "utf8_iter",
-]
-
-[[package]]
-name = "idna_adapter"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
-dependencies = [
- "icu_normalizer",
- "icu_properties",
-]
-
-[[package]]
-name = "indexmap"
-version = "1.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
-dependencies = [
- "autocfg",
- "hashbrown 0.12.3",
- "serde",
-]
-
-[[package]]
-name = "indexmap"
-version = "2.14.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
-dependencies = [
- "equivalent",
- "hashbrown 0.17.1",
- "serde",
- "serde_core",
-]
-
-[[package]]
-name = "infer"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4200d433cbd5178df7797c9c2e75b348b728e39631cf14520d1e2fc424201f4"
-dependencies = [
- "cfb",
-]
-
-[[package]]
-name = "inout"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b5cf4372d022092674a83b8febf5865f7a573cc0c5baec5e49c879b6a20978f"
-dependencies = [
- "block-padding",
- "hybrid-array",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.12.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0"
-
-[[package]]
-name = "is-docker"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3"
-dependencies = [
- "once_cell",
-]
-
-[[package]]
-name = "is-wsl"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5"
-dependencies = [
- "is-docker",
- "once_cell",
-]
-
-[[package]]
-name = "itertools"
-version = "0.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
-
-[[package]]
-name = "javascriptcore-rs"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc"
-dependencies = [
- "bitflags 1.3.2",
- "glib",
- "javascriptcore-rs-sys",
-]
-
-[[package]]
-name = "javascriptcore-rs-sys"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124"
-dependencies = [
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps",
-]
-
-[[package]]
-name = "jiff"
-version = "0.2.38"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2b005715dcbeb0089a3c0dab99f2ff1cc3b2525323552703d648585d342a383"
-dependencies = [
- "defmt",
- "jiff-core",
- "jiff-static",
- "jiff-tzdb-platform",
- "log",
- "portable-atomic",
- "portable-atomic-util",
- "serde_core",
- "windows-link",
-]
-
-[[package]]
-name = "jiff-core"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e52fe76043ccecc9005d2305ebaadf7d7fc0cc89ca6baa10a94d6bc68c7128c"
-dependencies = [
- "defmt",
- "log",
-]
-
-[[package]]
-name = "jiff-static"
-version = "0.2.38"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2cc9817253cf7c7ee4684451bd327e88d6f3658014e54a29198625590650695c"
-dependencies = [
- "jiff-core",
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "jiff-tzdb"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa8377070c6bae868759445e5a77f66d84f0b72f3a054bfb00e6d038b8282da7"
-
-[[package]]
-name = "jiff-tzdb-platform"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8"
-dependencies = [
- "jiff-tzdb",
-]
-
-[[package]]
-name = "jni"
-version = "0.21.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97"
-dependencies = [
- "cesu8",
- "cfg-if",
- "combine",
- "jni-sys 0.3.1",
- "log",
- "thiserror 1.0.69",
- "walkdir",
- "windows-sys 0.45.0",
-]
-
-[[package]]
-name = "jni"
-version = "0.22.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498"
-dependencies = [
- "cfg-if",
- "combine",
- "jni-macros",
- "jni-sys 0.4.1",
- "log",
- "simd_cesu8",
- "thiserror 2.0.21",
- "walkdir",
- "windows-link",
-]
-
-[[package]]
-name = "jni-macros"
-version = "0.22.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3"
-dependencies = [
- "proc-macro2",
- "quote",
- "rustc_version",
- "simd_cesu8",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "jni-sys"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258"
-dependencies = [
- "jni-sys 0.4.1",
-]
-
-[[package]]
-name = "jni-sys"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2"
-dependencies = [
- "jni-sys-macros",
-]
-
-[[package]]
-name = "jni-sys-macros"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264"
-dependencies = [
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "jobserver"
-version = "0.1.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"
-dependencies = [
- "getrandom 0.4.3",
- "libc",
-]
-
-[[package]]
-name = "js-sys"
-version = "0.3.106"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5"
-dependencies = [
- "cfg-if",
- "futures-util",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "json-patch"
-version = "4.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7421438de105a0827e44fadd05377727847d717c80ce29a229f85fd04c427b72"
-dependencies = [
- "jsonptr",
- "serde",
- "serde_json",
- "thiserror 2.0.21",
-]
-
-[[package]]
-name = "jsonptr"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a5a3cc660ba5d72bce0b3bb295bf20847ccbb40fd423f3f05b61273672e561fe"
-dependencies = [
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "keyboard-types"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d"
-dependencies = [
- "bitflags 2.13.2",
- "serde",
-]
-
-[[package]]
-name = "keyed_priority_queue"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ee7893dab2e44ae5f9d0173f26ff4aa327c10b01b06a72b52dd9405b628640d"
-dependencies = [
- "indexmap 2.14.2",
-]
-
-[[package]]
-name = "keyring"
-version = "3.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eebcc3aff044e5944a8fbaf69eb277d11986064cba30c468730e8b9909fb551c"
-dependencies = [
- "byteorder",
- "dbus-secret-service",
- "log",
- "security-framework 2.11.1",
- "security-framework 3.7.0",
- "windows-sys 0.60.2",
- "zeroize",
-]
-
-[[package]]
-name = "libappindicator"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a"
-dependencies = [
- "glib",
- "gtk",
- "gtk-sys",
- "libappindicator-sys",
- "log",
-]
-
-[[package]]
-name = "libappindicator-sys"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf"
-dependencies = [
- "gtk-sys",
- "libloading",
- "once_cell",
-]
-
-[[package]]
-name = "libc"
-version = "0.2.191"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
-
-[[package]]
-name = "libdbus-sys"
-version = "0.2.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "328c4789d42200f1eeec05bd86c9c13c7f091d2ba9a6ea35acdf51f31bc0f043"
-dependencies = [
- "pkg-config",
-]
-
-[[package]]
-name = "libloading"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
-dependencies = [
- "cfg-if",
- "winapi",
-]
-
-[[package]]
-name = "libredox"
-version = "0.1.25"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "libsqlite3-sys"
-version = "0.39.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14a5f01b87b92705d07b433c06f96cbc764637d81a0bffb5734ce17cf0f9a2b3"
-dependencies = [
- "cc",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
-name = "linux-raw-sys"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
-
-[[package]]
-name = "litemap"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"
-
-[[package]]
-name = "lock_api"
-version = "0.4.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
-dependencies = [
- "scopeguard",
-]
-
-[[package]]
-name = "log"
-version = "0.4.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
-
-[[package]]
-name = "lowquery"
-version = "0.5.7"
-dependencies = [
- "aes",
- "cbc",
- "chrono",
- "directories",
- "futures-util",
- "keyring",
- "mysql_async",
- "oracledb",
- "parking_lot",
- "quick-xml",
- "redis",
- "rusqlite",
- "rustls",
- "rustls-native-certs",
- "scylla",
- "serde",
- "serde_json",
- "tauri",
- "tauri-build",
- "tauri-plugin-dialog",
- "tauri-plugin-opener",
- "tauri-plugin-process",
- "tauri-plugin-updater",
- "thiserror 2.0.21",
- "tiberius",
- "tokio",
- "tokio-postgres",
- "tokio-postgres-rustls",
- "tokio-util",
- "uuid",
- "webpki-roots",
- "winreg",
-]
-
-[[package]]
-name = "lru"
-version = "0.18.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef9ac18847474e638e3702b76c65d4eb93428471a74778ef0f1be711717f89b5"
-dependencies = [
- "hashbrown 0.17.1",
-]
-
-[[package]]
-name = "lz4_flex"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ecbdfe44b1bd960b68170b417450a628c43f7cf56bb3c5317e61cb230ee7f226"
-dependencies = [
- "twox-hash",
-]
-
-[[package]]
-name = "manyhow"
-version = "0.11.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b33efb3ca6d3b07393750d4030418d594ab1139cee518f0dc88db70fec873587"
-dependencies = [
- "manyhow-macros",
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "manyhow-macros"
-version = "0.11.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46fce34d199b78b6e6073abf984c9cf5fd3e9330145a93ee0738a7443e371495"
-dependencies = [
- "proc-macro-utils",
- "proc-macro2",
- "quote",
-]
-
-[[package]]
-name = "markup5ever"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7122d987ec5f704ee56f6e5b41a7d93722e9aae27ae07cafa4036c4d3f9757de"
-dependencies = [
- "log",
- "tendril",
- "web_atoms",
-]
-
-[[package]]
-name = "md-5"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69b6441f590336821bb897fb28fc622898ccceb1d6cea3fde5ea86b090c4de98"
-dependencies = [
- "cfg-if",
- "digest 0.11.3",
-]
-
-[[package]]
-name = "md5"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e6bcd6433cff03a4bfc3d9834d504467db1f1cf6d0ea765d37d330249ed629d"
-
-[[package]]
-name = "memchr"
-version = "2.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
-
-[[package]]
-name = "memoffset"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "mime"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
-
-[[package]]
-name = "minisign-verify"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "871285dc19d8d0ebe0eef3d0e99a205f2a71363b122632cbbfa4a6c370a960ce"
-
-[[package]]
-name = "miniz_oxide"
-version = "0.8.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
-dependencies = [
- "adler2",
- "simd-adler32",
-]
-
-[[package]]
-name = "miniz_oxide"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c"
-dependencies = [
- "adler2",
- "simd-adler32",
-]
-
-[[package]]
-name = "mio"
-version = "1.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee"
-dependencies = [
- "libc",
- "wasi 0.11.1+wasi-snapshot-preview1",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "muda"
-version = "0.20.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cca139e57da4383727f189e43e66e84fa372347027fc996f9f1a007ec0a37996"
-dependencies = [
- "crossbeam-channel",
- "dpi",
- "gtk",
- "keyboard-types",
- "objc2",
- "objc2-app-kit",
- "objc2-core-foundation",
- "objc2-foundation",
- "once_cell",
- "png 0.18.1",
- "serde",
- "thiserror 2.0.21",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "multiversion_no_op"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d"
-
-[[package]]
-name = "mysql-common-derive"
-version = "0.32.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4db8a44120571277accfaa3f3d91e7d3989d601d817c2fc01a9391b86135666"
-dependencies = [
- "darling 0.23.0",
- "heck 0.5.0",
- "manyhow",
- "num-bigint",
- "proc-macro-crate 3.5.0",
- "proc-macro2",
- "quote",
- "syn 2.0.119",
- "termcolor",
- "thiserror 2.0.21",
-]
-
-[[package]]
-name = "mysql_async"
-version = "0.37.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40d11da0e2d9fad4640c9f9198ee431c6d68444568f83ef1f10f3367270071e4"
-dependencies = [
- "arc-swap",
- "bytes",
- "crossbeam-queue",
- "crossbeam-utils",
- "flate2",
- "futures-core",
- "futures-sink",
- "futures-util",
- "keyed_priority_queue",
- "lru",
- "mysql_common",
- "percent-encoding",
- "rand 0.10.3",
- "rustls",
- "serde",
- "socket2",
- "thiserror 2.0.21",
- "tokio",
- "tokio-rustls",
- "tokio-util",
- "twox-hash",
- "url",
- "webpki-roots",
-]
-
-[[package]]
-name = "mysql_common"
-version = "0.37.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f27695f286b461da077b8c2f72f47feaa04ce3c3f9c0976257410e90e21208a"
-dependencies = [
- "base64 0.22.1",
- "bitflags 2.13.2",
- "btoi",
- "byteorder",
- "bytes",
- "crc32fast",
- "flate2",
- "getrandom 0.3.4",
- "mysql-common-derive",
- "num-bigint",
- "num-traits",
- "regex",
- "saturating",
- "serde",
- "serde_json",
- "sha1",
- "sha2 0.10.9",
- "thiserror 2.0.21",
- "uuid",
-]
-
-[[package]]
-name = "ndk"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4"
-dependencies = [
- "bitflags 2.13.2",
- "jni-sys 0.3.1",
- "log",
- "ndk-sys",
- "num_enum",
- "raw-window-handle",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "ndk-context"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
-
-[[package]]
-name = "ndk-sys"
-version = "0.6.0+11769913"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873"
-dependencies = [
- "jni-sys 0.3.1",
-]
-
-[[package]]
-name = "new_debug_unreachable"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
-
-[[package]]
-name = "nix"
-version = "0.31.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d"
-dependencies = [
- "bitflags 2.13.2",
- "cfg-if",
- "cfg_aliases",
- "libc",
-]
-
-[[package]]
-name = "num-bigint"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367"
-dependencies = [
- "num-integer",
- "num-traits",
-]
-
-[[package]]
-name = "num-conv"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"
-
-[[package]]
-name = "num-integer"
-version = "0.1.47"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
-dependencies = [
- "num-traits",
-]
-
-[[package]]
-name = "num-traits"
-version = "0.2.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "num_enum"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26"
-dependencies = [
- "num_enum_derive",
- "rustversion",
-]
-
-[[package]]
-name = "num_enum_derive"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8"
-dependencies = [
- "proc-macro-crate 3.5.0",
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "objc2"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8"
-dependencies = [
- "objc2-encode",
- "objc2-exception-helper",
-]
-
-[[package]]
-name = "objc2-app-kit"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c"
-dependencies = [
- "bitflags 2.13.2",
- "block2",
- "objc2",
- "objc2-core-foundation",
- "objc2-foundation",
- "objc2-quartz-core",
-]
-
-[[package]]
-name = "objc2-cloud-kit"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c"
-dependencies = [
- "bitflags 2.13.2",
- "objc2",
- "objc2-foundation",
-]
-
-[[package]]
-name = "objc2-core-data"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa"
-dependencies = [
- "objc2",
- "objc2-foundation",
-]
-
-[[package]]
-name = "objc2-core-foundation"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
-dependencies = [
- "bitflags 2.13.2",
- "dispatch2",
- "objc2",
-]
-
-[[package]]
-name = "objc2-core-graphics"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807"
-dependencies = [
- "bitflags 2.13.2",
- "dispatch2",
- "objc2",
- "objc2-core-foundation",
- "objc2-io-surface",
-]
-
-[[package]]
-name = "objc2-core-image"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006"
-dependencies = [
- "objc2",
- "objc2-foundation",
-]
-
-[[package]]
-name = "objc2-core-location"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009"
-dependencies = [
- "objc2",
- "objc2-foundation",
-]
-
-[[package]]
-name = "objc2-core-text"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d"
-dependencies = [
- "bitflags 2.13.2",
- "objc2",
- "objc2-core-foundation",
- "objc2-core-graphics",
-]
-
-[[package]]
-name = "objc2-encode"
-version = "4.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"
-
-[[package]]
-name = "objc2-exception-helper"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "objc2-foundation"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"
-dependencies = [
- "bitflags 2.13.2",
- "block2",
- "libc",
- "objc2",
- "objc2-core-foundation",
-]
-
-[[package]]
-name = "objc2-io-surface"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"
-dependencies = [
- "bitflags 2.13.2",
- "objc2",
- "objc2-core-foundation",
-]
-
-[[package]]
-name = "objc2-osa-kit"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f112d1746737b0da274ef79a23aac283376f335f4095a083a267a082f21db0c0"
-dependencies = [
- "bitflags 2.13.2",
- "objc2",
- "objc2-app-kit",
- "objc2-foundation",
-]
-
-[[package]]
-name = "objc2-quartz-core"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f"
-dependencies = [
- "bitflags 2.13.2",
- "objc2",
- "objc2-core-foundation",
- "objc2-foundation",
-]
-
-[[package]]
-name = "objc2-system-configuration"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7216bd11cbda54ccabcab84d523dc93b858ec75ecfb3a7d89513fa22464da396"
-dependencies = [
- "objc2-core-foundation",
-]
-
-[[package]]
-name = "objc2-ui-kit"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22"
-dependencies = [
- "bitflags 2.13.2",
- "block2",
- "objc2",
- "objc2-cloud-kit",
- "objc2-core-data",
- "objc2-core-foundation",
- "objc2-core-graphics",
- "objc2-core-image",
- "objc2-core-location",
- "objc2-core-text",
- "objc2-foundation",
- "objc2-quartz-core",
- "objc2-user-notifications",
-]
-
-[[package]]
-name = "objc2-user-notifications"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e"
-dependencies = [
- "objc2",
- "objc2-foundation",
-]
-
-[[package]]
-name = "objc2-web-kit"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f"
-dependencies = [
- "bitflags 2.13.2",
- "block2",
- "objc2",
- "objc2-app-kit",
- "objc2-core-foundation",
- "objc2-foundation",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.21.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
-
-[[package]]
-name = "open"
-version = "5.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa576c76302b7b808eecc68061e67336c47833ef9d22caa74dda10fa9675eebc"
-dependencies = [
- "dunce",
- "is-wsl",
- "libc",
-]
-
-[[package]]
-name = "openssl-probe"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
-
-[[package]]
-name = "option-ext"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
-
-[[package]]
-name = "oracledb"
-version = "26.0.0-beta.4"
-dependencies = [
- "aes",
- "base16ct",
- "base64ct",
- "cbc",
- "chrono",
- "pbkdf2",
- "pkcs8",
- "rand 0.10.3",
- "rustls",
- "sha2 0.11.1",
- "uuid",
- "webpki-roots",
- "whoami",
-]
-
-[[package]]
-name = "ordered-stream"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
-dependencies = [
- "futures-core",
- "pin-project-lite",
-]
-
-[[package]]
-name = "osakit"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "732c71caeaa72c065bb69d7ea08717bd3f4863a4f451402fc9513e29dbd5261b"
-dependencies = [
- "objc2",
- "objc2-foundation",
- "objc2-osa-kit",
- "serde",
- "serde_json",
- "thiserror 2.0.21",
-]
-
-[[package]]
-name = "pango"
-version = "0.18.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4"
-dependencies = [
- "gio",
- "glib",
- "libc",
- "once_cell",
- "pango-sys",
-]
-
-[[package]]
-name = "pango-sys"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5"
-dependencies = [
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps",
-]
-
-[[package]]
-name = "parking"
-version = "2.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
-
-[[package]]
-name = "parking_lot"
-version = "0.12.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
-dependencies = [
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.9.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall",
- "smallvec",
- "windows-link",
-]
-
-[[package]]
-name = "pbkdf2"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "112d82ceb8c5bf524d9af484d4e4970c9fd5a0cc15ba14ad93dccd28873b0629"
-dependencies = [
- "digest 0.11.3",
- "hmac",
-]
-
-[[package]]
-name = "pem-rfc7468"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6305423e0e7738146434843d1694d621cce767262b2a86910beab705e4493d9"
-dependencies = [
- "base64ct",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
-
-[[package]]
-name = "phf"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
-dependencies = [
- "phf_macros",
- "phf_shared",
- "serde",
-]
-
-[[package]]
-name = "phf_codegen"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1"
-dependencies = [
- "phf_generator",
- "phf_shared",
-]
-
-[[package]]
-name = "phf_generator"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
-dependencies = [
- "fastrand",
- "phf_shared",
-]
-
-[[package]]
-name = "phf_macros"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef"
-dependencies = [
- "phf_generator",
- "phf_shared",
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "phf_shared"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
-dependencies = [
- "siphasher",
-]
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
-
-[[package]]
-name = "piper"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"
-dependencies = [
- "atomic-waker",
- "fastrand",
- "futures-io",
-]
-
-[[package]]
-name = "pkcs5"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63d440a804ec8d6fafbb6b84471e013286658d373248927692ab3366686220ca"
-dependencies = [
- "aes",
- "aes-gcm",
- "cbc",
- "der 0.8.2",
- "pbkdf2",
- "rand_core 0.10.1",
- "scrypt",
- "sha2 0.11.1",
- "spki 0.8.1",
-]
-
-[[package]]
-name = "pkcs8"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "451913da69c775a56034ea8d9003d27ee8948e12443eae7c038ba100a4f21cb7"
-dependencies = [
- "der 0.8.2",
- "pkcs5",
- "rand_core 0.10.1",
- "spki 0.8.1",
-]
-
-[[package]]
-name = "pkg-config"
-version = "0.3.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
-
-[[package]]
-name = "plist"
-version = "1.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2896bade328c13f7042a297ea5ac5b0951f6cf989dea5f32c2fd98da398195cb"
-dependencies = [
- "base64 0.23.1",
- "indexmap 2.14.2",
- "quick-xml",
- "serde",
- "time",
-]
-
-[[package]]
-name = "png"
-version = "0.17.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526"
-dependencies = [
- "bitflags 1.3.2",
- "crc32fast",
- "fdeflate",
- "flate2",
- "miniz_oxide 0.8.9",
-]
-
-[[package]]
-name = "png"
-version = "0.18.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"
-dependencies = [
- "bitflags 2.13.2",
- "crc32fast",
- "fdeflate",
- "flate2",
- "miniz_oxide 0.8.9",
-]
-
-[[package]]
-name = "polling"
-version = "3.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"
-dependencies = [
- "cfg-if",
- "concurrent-queue",
- "hermit-abi",
- "pin-project-lite",
- "rustix",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "polyval"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0fa31d631f2b2cb2a544d0aa321ce847a94764d701ca2becc411138b93d49cd"
-dependencies = [
- "cpubits",
- "cpufeatures 0.3.1",
- "universal-hash",
-]
-
-[[package]]
-name = "portable-atomic"
-version = "1.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
-
-[[package]]
-name = "portable-atomic-util"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715"
-dependencies = [
- "portable-atomic",
-]
-
-[[package]]
-name = "postgres-protocol"
-version = "0.6.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08808e3c483c46e999108051c78334f473d5adb59d78bb80a1268c7e6aa6c514"
-dependencies = [
- "base64 0.22.1",
- "byteorder",
- "bytes",
- "fallible-iterator 0.2.0",
- "hmac",
- "md-5",
- "memchr",
- "rand 0.10.3",
- "sha2 0.11.1",
- "stringprep",
-]
-
-[[package]]
-name = "postgres-types"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "851ca9db4932932d69f3ea811b1abe63087a0f740a47692619dd40d4899b68be"
-dependencies = [
- "bytes",
- "chrono",
- "fallible-iterator 0.2.0",
- "postgres-protocol",
- "serde_core",
- "serde_json",
- "uuid",
-]
-
-[[package]]
-name = "potential_utf"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"
-dependencies = [
- "zerovec",
-]
-
-[[package]]
-name = "powerfmt"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958"
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
-dependencies = [
- "zerocopy",
-]
-
-[[package]]
-name = "precomputed-hash"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
-
-[[package]]
-name = "pretty-hex"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a65843dfefbafd3c879c683306959a6de478443ffe9c9adf02f5976432402d7"
-
-[[package]]
-name = "proc-macro-crate"
-version = "1.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919"
-dependencies = [
- "once_cell",
- "toml_edit 0.19.15",
-]
-
-[[package]]
-name = "proc-macro-crate"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24"
-dependencies = [
- "toml_datetime 0.6.3",
- "toml_edit 0.20.2",
-]
-
-[[package]]
-name = "proc-macro-crate"
-version = "3.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"
-dependencies = [
- "toml_edit 0.25.17+spec-1.1.0",
-]
-
-[[package]]
-name = "proc-macro-error"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
-dependencies = [
- "proc-macro-error-attr",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-error-attr"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
-dependencies = [
- "proc-macro2",
- "quote",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-utils"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eeaf08a13de400bc215877b5bdc088f241b12eb42f0a548d3390dc1c56bb7071"
-dependencies = [
- "proc-macro2",
- "quote",
- "smallvec",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.107"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quick-xml"
-version = "0.42.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41b1177fdf999d2321d3fb46ff47159d9c1fb9ad66a4879f8c50a0b504615e9b"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.47"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "r-efi"
-version = "5.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
-
-[[package]]
-name = "r-efi"
-version = "6.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
-
-[[package]]
-name = "rand"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
-dependencies = [
- "getrandom 0.1.16",
- "libc",
- "rand_chacha 0.2.2",
- "rand_core 0.5.1",
- "rand_hc",
-]
-
-[[package]]
-name = "rand"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41"
-dependencies = [
- "rand_chacha 0.9.0",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af"
-dependencies = [
- "chacha20",
- "getrandom 0.4.3",
- "rand_core 0.10.1",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
-dependencies = [
- "getrandom 0.1.16",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
-dependencies = [
- "getrandom 0.3.4",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
-
-[[package]]
-name = "rand_hc"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
-dependencies = [
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_pcg"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b48ac3f7ffaab7fac4d2376632268aa5f89abdb55f7ebf8f4d11fffccb2320f7"
-dependencies = [
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "raw-window-handle"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539"
-
-[[package]]
-name = "redis"
-version = "1.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed5b98ae99461e02895c3a96a25dbe4d852a3d5e5b815d31d5d9e4b5344d99e9"
-dependencies = [
- "arcstr",
- "async-lock",
- "bytes",
- "cfg-if",
- "combine",
- "futures-util",
- "itoa",
- "percent-encoding",
- "pin-project-lite",
- "rustls",
- "rustls-native-certs",
- "ryu",
- "socket2",
- "tokio",
- "tokio-rustls",
- "tokio-util",
- "url",
- "webpki-roots",
- "xxhash-rust",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.5.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
-dependencies = [
- "bitflags 2.13.2",
-]
-
-[[package]]
-name = "redox_users"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0"
-dependencies = [
- "libredox",
- "thiserror 2.0.21",
-]
-
-[[package]]
-name = "ref-cast"
-version = "1.0.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3"
-dependencies = [
- "ref-cast-impl",
-]
-
-[[package]]
-name = "ref-cast-impl"
-version = "1.0.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "regex"
-version = "1.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-automata",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-automata"
-version = "0.4.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.8.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
-
-[[package]]
-name = "reqwest"
-version = "0.13.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16a1cfa75cc186dd73d5818e510e042e40927bccc9c236b061cea97e1eb08029"
-dependencies = [
- "base64 0.23.1",
- "bytes",
- "futures-core",
- "futures-util",
- "http",
- "http-body",
- "http-body-util",
- "hyper",
- "hyper-rustls",
- "hyper-util",
- "js-sys",
- "log",
- "percent-encoding",
- "pin-project-lite",
- "rustls",
- "rustls-pki-types",
- "rustls-platform-verifier",
- "serde",
- "serde_json",
- "sync_wrapper",
- "tokio",
- "tokio-rustls",
- "tokio-util",
- "tower",
- "tower-http",
- "tower-service",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "wasm-streams",
- "web-sys",
-]
-
-[[package]]
-name = "rfd"
-version = "0.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a15ad77d9e70a92437d8f74c35d99b4e4691128df018833e99f90bcd36152672"
-dependencies = [
- "block2",
- "dispatch2",
- "glib-sys",
- "gobject-sys",
- "gtk-sys",
- "js-sys",
- "log",
- "objc2",
- "objc2-app-kit",
- "objc2-core-foundation",
- "objc2-foundation",
- "raw-window-handle",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
- "windows-sys 0.60.2",
-]
-
-[[package]]
-name = "ring"
-version = "0.17.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
-dependencies = [
- "cc",
- "cfg-if",
- "getrandom 0.2.17",
- "libc",
- "untrusted",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "rsqlite-vfs"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c"
-dependencies = [
- "hashbrown 0.16.1",
- "thiserror 2.0.21",
-]
-
-[[package]]
-name = "rusqlite"
-version = "0.41.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da9bba6f3506135e120a6586df05be18b48d18896600646a4bec8f993d91a594"
-dependencies = [
- "bitflags 2.13.2",
- "fallible-iterator 0.3.0",
- "fallible-streaming-iterator",
- "hashlink",
- "libsqlite3-sys",
- "smallvec",
- "sqlite-wasm-rs",
-]
-
-[[package]]
-name = "rustc-hash"
-version = "2.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
-
-[[package]]
-name = "rustc_version"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rustix"
-version = "1.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "891efababe418670775f199f0d233d84843c227a0949a883ce15b37c78d6629d"
-dependencies = [
- "bitflags 2.13.2",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "rustls"
-version = "0.23.46"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
-dependencies = [
- "aws-lc-rs",
- "log",
- "once_cell",
- "ring",
- "rustls-pki-types",
- "rustls-webpki",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "rustls-native-certs"
-version = "0.8.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a073f5dc7469f984c52ad2752b63b0807745133b6de880b7b64c1ac4c48aec4"
-dependencies = [
- "openssl-probe",
- "rustls-pki-types",
- "schannel",
- "security-framework 3.7.0",
-]
-
-[[package]]
-name = "rustls-pki-types"
-version = "1.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"
-dependencies = [
- "zeroize",
-]
-
-[[package]]
-name = "rustls-platform-verifier"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98"
-dependencies = [
- "core-foundation 0.10.1",
- "core-foundation-sys",
- "jni 0.22.4",
- "log",
- "once_cell",
- "rustls",
- "rustls-native-certs",
- "rustls-platform-verifier-android",
- "rustls-webpki",
- "security-framework 3.7.0",
- "security-framework-sys",
- "webpki-root-certs",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "rustls-platform-verifier-android"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f"
-
-[[package]]
-name = "rustls-webpki"
-version = "0.103.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281"
-dependencies = [
- "aws-lc-rs",
- "ring",
- "rustls-pki-types",
- "untrusted",
-]
-
-[[package]]
-name = "rustversion"
-version = "1.0.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
-
-[[package]]
-name = "ryu"
-version = "1.0.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
-
-[[package]]
-name = "salsa20"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f874456e72520ff1375a06c588eaf074b0f01f9e9e1aada45bd9b7954a6e42c"
-dependencies = [
- "cfg-if",
- "cipher",
-]
-
-[[package]]
-name = "same-file"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "saturating"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ece8e78b2f38ec51c51f5d475df0a7187ba5111b2a28bdc761ee05b075d40a71"
-
-[[package]]
-name = "schannel"
-version = "0.1.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5"
-dependencies = [
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "schemars"
-version = "0.8.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615"
-dependencies = [
- "dyn-clone",
- "indexmap 1.9.3",
- "schemars_derive",
- "serde",
- "serde_json",
- "url",
- "uuid",
-]
-
-[[package]]
-name = "schemars"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f"
-dependencies = [
- "dyn-clone",
- "ref-cast",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "schemars"
-version = "1.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e"
-dependencies = [
- "dyn-clone",
- "ref-cast",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "schemars_derive"
-version = "0.8.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d"
-dependencies = [
- "proc-macro2",
- "quote",
- "serde_derive_internals",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
-
-[[package]]
-name = "scrypt"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d87af57419b594aa23fa95f09f0e06d80d84ba01c26148c43844cad6ff4485f0"
-dependencies = [
- "cfg-if",
- "pbkdf2",
- "salsa20",
- "sha2 0.11.1",
-]
-
-[[package]]
-name = "scylla"
-version = "1.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29eebcb7e34257f8ce01aaa1469644825bd4b4995d401c362be65d994e3feaa3"
-dependencies = [
- "arc-swap",
- "async-trait",
- "bytes",
- "chrono",
- "dashmap",
- "futures",
- "hashbrown 0.17.1",
- "itertools",
- "rand 0.9.5",
- "rand_pcg",
- "rustls",
- "scylla-cql",
- "scylla-cql-core",
- "serde",
- "serde_json",
- "smallvec",
- "socket2",
- "thiserror 2.0.21",
- "tokio",
- "tokio-rustls",
- "tracing",
- "uuid",
-]
-
-[[package]]
-name = "scylla-cql"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a398b0e78fb3872c4d5afc74e461d6b80dd69d030e13ddc7442e5f32c482e0da"
-dependencies = [
- "byteorder",
- "bytes",
- "chrono",
- "itertools",
- "lz4_flex",
- "scylla-cql-core",
- "snap",
- "stable_deref_trait",
- "thiserror 2.0.21",
- "tokio",
- "uuid",
- "yoke",
-]
-
-[[package]]
-name = "scylla-cql-core"
-version = "1.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72ca9de2eb08d04a9c85002ac179c51353c91152cd2cd58fc3d7cbc1eee8ab16"
-dependencies = [
- "byteorder",
- "bytes",
- "chrono",
- "itertools",
- "scylla-macros",
- "thiserror 2.0.21",
- "uuid",
-]
-
-[[package]]
-name = "scylla-macros"
-version = "1.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c82c9c67cb4912cefc8cb2a68ebdcbe0273b66510c2bb06581ae6b68d98498aa"
-dependencies = [
- "darling 0.24.1",
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "secrecy"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a"
-dependencies = [
- "zeroize",
-]
-
-[[package]]
-name = "security-framework"
-version = "2.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
-dependencies = [
- "bitflags 2.13.2",
- "core-foundation 0.9.4",
- "core-foundation-sys",
- "libc",
- "security-framework-sys",
-]
-
-[[package]]
-name = "security-framework"
-version = "3.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"
-dependencies = [
- "bitflags 2.13.2",
- "core-foundation 0.10.1",
- "core-foundation-sys",
- "libc",
- "security-framework-sys",
-]
-
-[[package]]
-name = "security-framework-sys"
-version = "2.17.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "selectors"
-version = "0.38.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8adfa1c298912827b8a28b223b3b874357397ae706e6190acd9bf28cee99114d"
-dependencies = [
- "bitflags 2.13.2",
- "cssparser",
- "derive_more",
- "log",
- "new_debug_unreachable",
- "phf",
- "phf_codegen",
- "precomputed-hash",
- "rustc-hash",
- "servo_arc",
- "smallvec",
-]
-
-[[package]]
-name = "semver"
-version = "1.0.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
-dependencies = [
- "serde",
- "serde_core",
-]
-
-[[package]]
-name = "serde"
-version = "1.0.229"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
-dependencies = [
- "serde_core",
- "serde_derive",
-]
-
-[[package]]
-name = "serde-untagged"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058"
-dependencies = [
- "erased-serde",
- "serde",
- "serde_core",
- "typeid",
-]
-
-[[package]]
-name = "serde_core"
-version = "1.0.229"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.229"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "serde_derive_internals"
-version = "0.29.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.154"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
-dependencies = [
- "foldhash",
- "indexmap 2.14.2",
- "itoa",
- "memchr",
- "serde",
- "serde_core",
- "zmij",
-]
-
-[[package]]
-name = "serde_repr"
-version = "0.1.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "serde_spanned"
-version = "0.6.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "serde_spanned"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "serde_with"
-version = "3.24.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df9adc193c780ef8f159aee8b61e2d5801aaa555e6eb0947fe45530ec506296f"
-dependencies = [
- "base64 0.23.1",
- "bs58",
- "chrono",
- "hex",
- "indexmap 1.9.3",
- "indexmap 2.14.2",
- "jiff",
- "schemars 0.9.0",
- "schemars 1.2.3",
- "serde_core",
- "serde_json",
- "serde_with_macros",
- "time",
-]
-
-[[package]]
-name = "serde_with_macros"
-version = "3.24.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e17bbc68e28663bbbb90df47e058aa7eda4fb445b89fe70457bb94fbccf6e49"
-dependencies = [
- "darling 0.24.1",
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "serialize-to-javascript"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5"
-dependencies = [
- "serde",
- "serde_json",
- "serialize-to-javascript-impl",
-]
-
-[[package]]
-name = "serialize-to-javascript-impl"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "servo_arc"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930"
-dependencies = [
- "stable_deref_trait",
-]
-
-[[package]]
-name = "sha1"
-version = "0.10.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8"
-dependencies = [
- "cfg-if",
- "cpufeatures 0.2.17",
- "digest 0.10.7",
-]
-
-[[package]]
-name = "sha2"
-version = "0.10.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
-dependencies = [
- "cfg-if",
- "cpufeatures 0.2.17",
- "digest 0.10.7",
-]
-
-[[package]]
-name = "sha2"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19"
-dependencies = [
- "cfg-if",
- "cpufeatures 0.3.1",
- "digest 0.11.3",
-]
-
-[[package]]
-name = "shlex"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
-
-[[package]]
-name = "signal-hook-registry"
-version = "1.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
-dependencies = [
- "errno",
- "libc",
-]
-
-[[package]]
-name = "simd-adler32"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
-
-[[package]]
-name = "simd_cesu8"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520"
-dependencies = [
- "rustc_version",
- "simdutf8",
-]
-
-[[package]]
-name = "simdutf8"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
-
-[[package]]
-name = "siphasher"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256"
-
-[[package]]
-name = "slab"
-version = "0.4.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
-
-[[package]]
-name = "smallvec"
-version = "1.16.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b3dc8af474f516a851ff4bd12db780f948b9250ad37211e4eec0bccea54e01b"
-
-[[package]]
-name = "snap"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "199905e6153d6405f9728fe44daace35f8f837bbf830bb6e85fbd5828709a886"
-
-[[package]]
-name = "socket2"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
-dependencies = [
- "libc",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "softbuffer"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3"
-dependencies = [
- "bytemuck",
- "js-sys",
- "ndk",
- "objc2",
- "objc2-core-foundation",
- "objc2-core-graphics",
- "objc2-foundation",
- "objc2-quartz-core",
- "raw-window-handle",
- "redox_syscall",
- "tracing",
- "wasm-bindgen",
- "web-sys",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "soup3"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f"
-dependencies = [
- "futures-channel",
- "gio",
- "glib",
- "libc",
- "soup3-sys",
-]
-
-[[package]]
-name = "soup3-sys"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27"
-dependencies = [
- "gio-sys",
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps",
-]
-
-[[package]]
-name = "spki"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d"
-dependencies = [
- "base64ct",
- "der 0.7.10",
-]
-
-[[package]]
-name = "spki"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ef958a98b9d5da290cfc78946e9f3e61e1e62a18db0d92cac0b83cc161491a9"
-dependencies = [
- "base64ct",
- "der 0.8.2",
-]
-
-[[package]]
-name = "sqlite-wasm-rs"
-version = "0.5.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc3efc0da82635d7e1ced0053bbbfa8c7ab9645d0bf36ceb4f7127bb85315d75"
-dependencies = [
- "cc",
- "js-sys",
- "rsqlite-vfs",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "stable_deref_trait"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
-
-[[package]]
-name = "static_vcruntime"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff7589a1859b09232522bb9edf076ca7fcf14ded96685d3fa629db73023ffbb7"
-
-[[package]]
-name = "string_cache"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901"
-dependencies = [
- "new_debug_unreachable",
- "parking_lot",
- "phf_shared",
- "precomputed-hash",
-]
-
-[[package]]
-name = "string_cache_codegen"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69"
-dependencies = [
- "phf_generator",
- "phf_shared",
- "proc-macro2",
- "quote",
-]
-
-[[package]]
-name = "stringprep"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1"
-dependencies = [
- "unicode-bidi",
- "unicode-normalization",
- "unicode-properties",
-]
-
-[[package]]
-name = "strsim"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
-
-[[package]]
-name = "subtle"
-version = "2.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
-
-[[package]]
-name = "swift-rs"
-version = "1.0.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cefd87076fd385308ee4aff597256c902f1fbb4d031de1558efc12f8ffefadd9"
-dependencies = [
- "base64 0.21.7",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "syn"
-version = "1.0.109"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
-dependencies = [
- "proc-macro2",
- "unicode-ident",
-]
-
-[[package]]
-name = "syn"
-version = "2.0.119"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "syn"
-version = "3.0.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "sync_wrapper"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
-dependencies = [
- "futures-core",
-]
-
-[[package]]
-name = "synstructure"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "system-configuration"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b"
-dependencies = [
- "bitflags 2.13.2",
- "core-foundation 0.9.4",
- "system-configuration-sys",
-]
-
-[[package]]
-name = "system-configuration-sys"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "system-deps"
-version = "6.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349"
-dependencies = [
- "cfg-expr",
- "heck 0.5.0",
- "pkg-config",
- "toml 0.8.2",
- "version-compare",
-]
-
-[[package]]
-name = "tao"
-version = "0.37.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f37f381f4e048e6cdf038b5705f8cf14ad108279d46eb968140a7b291aba9400"
-dependencies = [
- "bitflags 2.13.2",
- "block2",
- "core-foundation 0.10.1",
- "core-graphics",
- "crossbeam-channel",
- "dbus",
- "dispatch2",
- "dlopen2",
- "dpi",
- "gdkwayland-sys",
- "gdkx11-sys",
- "gtk",
- "jni 0.21.1",
- "libc",
- "log",
- "ndk",
- "ndk-context",
- "ndk-sys",
- "objc2",
- "objc2-app-kit",
- "objc2-foundation",
- "objc2-ui-kit",
- "parking_lot",
- "percent-encoding",
- "raw-window-handle",
- "tao-macros",
- "unicode-segmentation",
- "url",
- "windows",
- "windows-core",
- "windows-version",
- "x11-dl",
-]
-
-[[package]]
-name = "tao-macros"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f7eeb6d99155545da6150a1795945f16ac9c178deb2a5f2e74d776107bd5849"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "tar"
-version = "0.4.46"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840"
-dependencies = [
- "filetime",
- "libc",
- "xattr",
-]
-
-[[package]]
-name = "target-lexicon"
-version = "0.12.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
-
-[[package]]
-name = "tauri"
-version = "2.12.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f316751027fc2644221d1a448564d519efb07067fda584879d9cda966391d212"
-dependencies = [
- "anyhow",
- "bytes",
- "cookie",
- "dirs",
- "dunce",
- "embed_plist",
- "getrandom 0.3.4",
- "glob",
- "gtk",
- "heck 0.5.0",
- "http",
- "jni 0.21.1",
- "libc",
- "log",
- "mime",
- "muda",
- "objc2",
- "objc2-app-kit",
- "objc2-foundation",
- "objc2-ui-kit",
- "objc2-web-kit",
- "percent-encoding",
- "plist",
- "raw-window-handle",
- "reqwest",
- "serde",
- "serde_json",
- "serde_repr",
- "serialize-to-javascript",
- "swift-rs",
- "tauri-build",
- "tauri-macros",
- "tauri-runtime",
- "tauri-runtime-wry",
- "tauri-utils",
- "thiserror 2.0.21",
- "tokio",
- "tray-icon",
- "url",
- "webkit2gtk",
- "webview2-com",
- "window-vibrancy",
- "windows",
-]
-
-[[package]]
-name = "tauri-build"
-version = "2.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "641dd5fd297c99ab92717b0428cca5b9c6f960b2ac96ca131b3eebc9d70b8ddc"
-dependencies = [
- "anyhow",
- "cargo_toml",
- "dirs",
- "glob",
- "heck 0.5.0",
- "json-patch",
- "schemars 0.8.22",
- "semver",
- "serde",
- "serde_json",
- "static_vcruntime",
- "strsim",
- "tauri-utils",
- "tauri-winres",
- "walkdir",
-]
-
-[[package]]
-name = "tauri-codegen"
-version = "2.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6585c5b536c00f039d12ce70a9755172d5423bbcfd3969863baa70314c3e02f"
-dependencies = [
- "base64 0.23.1",
- "brotli",
- "ico",
- "json-patch",
- "plist",
- "png 0.18.1",
- "proc-macro2",
- "quote",
- "semver",
- "serde",
- "serde_json",
- "sha2 0.10.9",
- "syn 2.0.119",
- "tauri-utils",
- "thiserror 2.0.21",
- "time",
- "url",
- "uuid",
- "walkdir",
-]
-
-[[package]]
-name = "tauri-macros"
-version = "2.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2e83a0cfa1bae376e8fbbdc0b1692707aed50cd6072ce85cae4789af5d6c19f"
-dependencies = [
- "heck 0.5.0",
- "proc-macro2",
- "quote",
- "syn 2.0.119",
- "tauri-codegen",
- "tauri-utils",
-]
-
-[[package]]
-name = "tauri-plugin"
-version = "2.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67fb21a77e8f94e8beb3325e583102488659365af0a3948b7ea244c5b779c291"
-dependencies = [
- "anyhow",
- "glob",
- "plist",
- "schemars 0.8.22",
- "serde",
- "serde_json",
- "tauri-utils",
- "walkdir",
-]
-
-[[package]]
-name = "tauri-plugin-dialog"
-version = "2.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7461aaacf1901915ea7b9f5cd74f8224a351ed96af0a62c07fce934003cb34b"
-dependencies = [
- "log",
- "raw-window-handle",
- "rfd",
- "serde",
- "serde_json",
- "tauri",
- "tauri-plugin",
- "tauri-plugin-fs",
- "thiserror 2.0.21",
- "url",
-]
-
-[[package]]
-name = "tauri-plugin-fs"
-version = "2.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d58eb1d4984e535f47a642ffec09a2da6f5c18a12b5902d12126cb7626d628b"
-dependencies = [
- "anyhow",
- "dunce",
- "glob",
- "log",
- "objc2-foundation",
- "percent-encoding",
- "schemars 0.8.22",
- "serde",
- "serde_json",
- "serde_repr",
- "tauri",
- "tauri-plugin",
- "tauri-utils",
- "thiserror 2.0.21",
- "toml 1.1.8+spec-1.1.0",
- "url",
-]
-
-[[package]]
-name = "tauri-plugin-opener"
-version = "2.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53810be1b4fed22bb6ac3f4cab5a2b80d9391d1af436bda145607532bc0bb219"
-dependencies = [
- "dunce",
- "glob",
- "objc2-app-kit",
- "objc2-foundation",
- "open",
- "schemars 0.8.22",
- "serde",
- "serde_json",
- "tauri",
- "tauri-plugin",
- "thiserror 2.0.21",
- "url",
- "windows",
- "zbus",
-]
-
-[[package]]
-name = "tauri-plugin-process"
-version = "2.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74ae3d8549ae564c0397377373e262f340908eb23a5b9fbe03f2a00007dc0038"
-dependencies = [
- "tauri",
- "tauri-plugin",
-]
-
-[[package]]
-name = "tauri-plugin-updater"
-version = "2.14.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d957abbcb3f9f6c76d22a3a0f012f30880640d0bccb5634d2b12a9937e4c872b"
-dependencies = [
- "base64 0.23.1",
- "dirs",
- "flate2",
- "futures-util",
- "http",
- "infer",
- "libc",
- "log",
- "minisign-verify",
- "osakit",
- "percent-encoding",
- "reqwest",
- "rustls",
- "semver",
- "serde",
- "serde_json",
- "tar",
- "tauri",
- "tauri-plugin",
- "tempfile",
- "thiserror 2.0.21",
- "time",
- "tokio",
- "url",
- "windows-sys 0.61.2",
- "zip",
-]
-
-[[package]]
-name = "tauri-runtime"
-version = "2.12.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c55766d99cea69055904d1735b93c2049302b2e09effd462120deb5581d78e9"
-dependencies = [
- "cookie",
- "dpi",
- "gtk",
- "http",
- "jni 0.21.1",
- "objc2",
- "objc2-ui-kit",
- "objc2-web-kit",
- "raw-window-handle",
- "serde",
- "serde_json",
- "tauri-utils",
- "thiserror 2.0.21",
- "url",
- "webkit2gtk",
- "webview2-com",
- "windows",
-]
-
-[[package]]
-name = "tauri-runtime-wry"
-version = "2.12.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d61892587aea2a85245bcaec98c6fe46268874c0a0deae5535fb71ca7b93eae"
-dependencies = [
- "gtk",
- "http",
- "jni 0.21.1",
- "log",
- "objc2",
- "objc2-app-kit",
- "once_cell",
- "percent-encoding",
- "raw-window-handle",
- "softbuffer",
- "tao",
- "tauri-runtime",
- "tauri-utils",
- "url",
- "webkit2gtk",
- "webview2-com",
- "windows",
- "wry",
-]
-
-[[package]]
-name = "tauri-utils"
-version = "2.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "362ab21cd4cc713f2a02b1a9b5688198b1541cfb6907c4281e9190e0f0ef4aa3"
-dependencies = [
- "anyhow",
- "brotli",
- "cargo_metadata",
- "ctor",
- "dom_query",
- "dunce",
- "glob",
- "http",
- "infer",
- "json-patch",
- "log",
- "memchr",
- "phf",
- "plist",
- "proc-macro2",
- "quote",
- "regex",
- "schemars 0.8.22",
- "semver",
- "serde",
- "serde-untagged",
- "serde_json",
- "serde_with",
- "swift-rs",
- "thiserror 2.0.21",
- "toml 1.1.8+spec-1.1.0",
- "url",
- "urlpattern",
- "uuid",
- "walkdir",
-]
-
-[[package]]
-name = "tauri-winres"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c52bb6904475a6ca662f15ef787f18ade61d5740a1ee12c45d3b748efdb6f796"
-dependencies = [
- "dunce",
- "embed-resource",
- "toml 1.1.8+spec-1.1.0",
-]
-
-[[package]]
-name = "tempfile"
-version = "3.27.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
-dependencies = [
- "fastrand",
- "getrandom 0.4.3",
- "once_cell",
- "rustix",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "tendril"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fed54709c5b3a53d09bb1c113ea4f5ceafd1e772ddcb0030a82e1d56c087b08"
-dependencies = [
- "new_debug_unreachable",
-]
-
-[[package]]
-name = "termcolor"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
-dependencies = [
- "thiserror-impl 1.0.69",
-]
-
-[[package]]
-name = "thiserror"
-version = "2.0.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
-dependencies = [
- "thiserror-impl 2.0.21",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "tiberius"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e07324791de2bdaed058af4aa433a0b5ec5c0beac407a9797419c19805df2415"
-dependencies = [
- "async-trait",
- "asynchronous-codec",
- "byteorder",
- "bytes",
- "connection-string",
- "encoding_rs",
- "enumflags2",
- "futures-timer",
- "futures-util",
- "libc",
- "num-traits",
- "once_cell",
- "pin-project-lite",
- "pretty-hex",
- "rustls-native-certs",
- "rustls-pki-types",
- "rustls-webpki",
- "secrecy",
- "thiserror 2.0.21",
- "tiberius-macros",
- "tokio",
- "tokio-rustls",
- "tokio-util",
- "tracing",
- "uuid",
- "winauth",
- "zeroize",
-]
-
-[[package]]
-name = "tiberius-macros"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "907fed5ea55695d902cc3359fffa4a35021dfa9b95ab4eb9c8376d42ffb9eec8"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "time"
-version = "0.3.55"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134"
-dependencies = [
- "deranged",
- "num-conv",
- "powerfmt",
- "serde_core",
- "time-core",
- "time-macros",
-]
-
-[[package]]
-name = "time-core"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"
-
-[[package]]
-name = "time-macros"
-version = "0.2.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85"
-dependencies = [
- "num-conv",
- "time-core",
-]
-
-[[package]]
-name = "tinystr"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643"
-dependencies = [
- "displaydoc",
- "zerovec",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.13.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee"
-
-[[package]]
-name = "tls_codec"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0de2e01245e2bb89d6f05801c564fa27624dbd7b1846859876c7dad82e90bf6b"
-dependencies = [
- "tls_codec_derive",
- "zeroize",
-]
-
-[[package]]
-name = "tls_codec_derive"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d2e76690929402faae40aebdda620a2c0e25dd6d3b9afe48867dfd95991f4bd"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "tokio"
-version = "1.54.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3"
-dependencies = [
- "bytes",
- "libc",
- "mio",
- "pin-project-lite",
- "socket2",
- "tokio-macros",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "tokio-macros"
-version = "2.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "tokio-postgres"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a528f7d280f6d5b9cd149635c8705b0dd049754bc67d81d31fa25169a93809d3"
-dependencies = [
- "async-trait",
- "byteorder",
- "bytes",
- "fallible-iterator 0.2.0",
- "futures-channel",
- "futures-util",
- "log",
- "parking_lot",
- "percent-encoding",
- "phf",
- "pin-project-lite",
- "postgres-protocol",
- "postgres-types",
- "rand 0.10.3",
- "socket2",
- "tokio",
- "tokio-util",
- "whoami",
-]
-
-[[package]]
-name = "tokio-postgres-rustls"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "27d684bad428a0f2481f42241f821db42c54e2dc81d8c00db8536c506b0a0144"
-dependencies = [
- "const-oid 0.9.6",
- "ring",
- "rustls",
- "tokio",
- "tokio-postgres",
- "tokio-rustls",
- "x509-cert",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.26.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db"
-dependencies = [
- "rustls",
- "tokio",
-]
-
-[[package]]
-name = "tokio-util"
-version = "0.7.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-io",
- "futures-sink",
- "libc",
- "pin-project-lite",
- "tokio",
-]
-
-[[package]]
-name = "toml"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d"
-dependencies = [
- "serde",
- "serde_spanned 0.6.9",
- "toml_datetime 0.6.3",
- "toml_edit 0.20.2",
-]
-
-[[package]]
-name = "toml"
-version = "1.1.8+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d"
-dependencies = [
- "indexmap 2.14.2",
- "serde_core",
- "serde_spanned 1.1.2",
- "toml_datetime 1.1.2+spec-1.1.0",
- "toml_parser",
- "toml_writer",
- "winnow 1.0.4",
-]
-
-[[package]]
-name = "toml_datetime"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "toml_datetime"
-version = "1.1.2+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "toml_edit"
-version = "0.19.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
-dependencies = [
- "indexmap 2.14.2",
- "toml_datetime 0.6.3",
- "winnow 0.5.40",
-]
-
-[[package]]
-name = "toml_edit"
-version = "0.20.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338"
-dependencies = [
- "indexmap 2.14.2",
- "serde",
- "serde_spanned 0.6.9",
- "toml_datetime 0.6.3",
- "winnow 0.5.40",
-]
-
-[[package]]
-name = "toml_edit"
-version = "0.25.17+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c"
-dependencies = [
- "indexmap 2.14.2",
- "toml_datetime 1.1.2+spec-1.1.0",
- "toml_parser",
- "winnow 1.0.4",
-]
-
-[[package]]
-name = "toml_parser"
-version = "1.1.5+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c"
-dependencies = [
- "winnow 1.0.4",
-]
-
-[[package]]
-name = "toml_writer"
-version = "1.1.3+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06bdbd8cfc056b8d2e2e85f29b56a3bdbecb527cef81eb39e3e7b98af4652770"
-
-[[package]]
-name = "tower"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"
-dependencies = [
- "futures-core",
- "futures-util",
- "pin-project-lite",
- "sync_wrapper",
- "tokio",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-http"
-version = "0.6.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840"
-dependencies = [
- "bitflags 2.13.2",
- "bytes",
- "futures-util",
- "http",
- "http-body",
- "pin-project-lite",
- "tower",
- "tower-layer",
- "tower-service",
- "url",
-]
-
-[[package]]
-name = "tower-layer"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
-
-[[package]]
-name = "tower-service"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
-
-[[package]]
-name = "tracing"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
-dependencies = [
- "log",
- "pin-project-lite",
- "tracing-attributes",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-attributes"
-version = "0.1.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
-dependencies = [
- "once_cell",
-]
-
-[[package]]
-name = "tray-icon"
-version = "0.25.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2b9c52859a94554803ccd4a24b98f74148ebc73b90676d783f3490b1bff9d72"
-dependencies = [
- "crossbeam-channel",
- "dirs",
- "libappindicator",
- "muda",
- "objc2",
- "objc2-app-kit",
- "objc2-core-foundation",
- "objc2-core-graphics",
- "objc2-foundation",
- "once_cell",
- "png 0.18.1",
- "serde",
- "thiserror 2.0.21",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "try-lock"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
-
-[[package]]
-name = "twox-hash"
-version = "2.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86a801b3cea342a06d468c8710662aa29e5e05e4f5c0d62f00bbb7f2ad7941c2"
-
-[[package]]
-name = "typed-path"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e"
-
-[[package]]
-name = "typeid"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c"
-
-[[package]]
-name = "typenum"
-version = "1.20.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
-
-[[package]]
-name = "uds_windows"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
-dependencies = [
- "memoffset",
- "tempfile",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "unicode-bidi"
-version = "0.3.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5"
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
-
-[[package]]
-name = "unicode-normalization"
-version = "0.1.26"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75cd3fb03d5288b3ba9a1ee103ac7e9cbb59f0b03d64f8ddfcc04dd42758a85d"
-dependencies = [
- "tinyvec",
-]
-
-[[package]]
-name = "unicode-properties"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d"
-
-[[package]]
-name = "unicode-segmentation"
-version = "1.13.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
-
-[[package]]
-name = "universal-hash"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4987bdc12753382e0bec4a65c50738ffaabc998b9cdd1f952fb5f39b0048a96"
-dependencies = [
- "crypto-common 0.2.2",
- "ctutils",
-]
-
-[[package]]
-name = "untrusted"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
-
-[[package]]
-name = "url"
-version = "2.5.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
-dependencies = [
- "form_urlencoded",
- "idna",
- "percent-encoding",
- "serde",
- "serde_derive",
-]
-
-[[package]]
-name = "urlpattern"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df16f50ef4cc145211879a3867ba757076b25dfee812040dcb0658bd9ae7904b"
-dependencies = [
- "icu_properties",
- "regex",
- "serde",
- "url",
-]
-
-[[package]]
-name = "utf8_iter"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
-
-[[package]]
-name = "uuid"
-version = "1.28.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7cc1186384beb7dd8eedea376413fd654937285ea6c9cfbb928dc3043ea4b606"
-dependencies = [
- "getrandom 0.4.3",
- "js-sys",
- "serde_core",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "vcpkg"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
-
-[[package]]
-name = "version-compare"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e"
-
-[[package]]
-name = "version_check"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
-
-[[package]]
-name = "vswhom"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b"
-dependencies = [
- "libc",
- "vswhom-sys",
-]
-
-[[package]]
-name = "vswhom-sys"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[package]]
-name = "walkdir"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
-dependencies = [
- "same-file",
- "winapi-util",
-]
-
-[[package]]
-name = "want"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec4cdd0dd910afe868b7ef477227d8d538b46b3075031afee8a9f2acb0a2ed0b"
-dependencies = [
- "try-lock",
-]
-
-[[package]]
-name = "wasi"
-version = "0.9.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
-
-[[package]]
-name = "wasi"
-version = "0.11.1+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
-
-[[package]]
-name = "wasi"
-version = "0.14.7+wasi-0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c"
-dependencies = [
- "wasip2",
-]
-
-[[package]]
-name = "wasip2"
-version = "1.0.4+wasi-0.2.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487"
-dependencies = [
- "wit-bindgen",
-]
-
-[[package]]
-name = "wasite"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "66fe902b4a6b8028a753d5424909b764ccf79b7a209eac9bf97e59cda9f71a42"
-dependencies = [
- "wasi 0.14.7+wasi-0.2.4",
-]
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.129"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409"
-dependencies = [
- "cfg-if",
- "once_cell",
- "rustversion",
- "wasm-bindgen-macro",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-futures"
-version = "0.4.79"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3cbab34de2d982e9b48e18d216d04c4a6f641066ff19ffb699980f591ee3610e"
-dependencies = [
- "js-sys",
- "tokio",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.129"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.129"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7"
-dependencies = [
- "bumpalo",
- "proc-macro2",
- "quote",
- "syn 3.0.9",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.129"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "wasm-streams"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb"
-dependencies = [
- "futures-util",
- "js-sys",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
-]
-
-[[package]]
-name = "web-sys"
-version = "0.3.106"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88261b9deccee56594c11a3460c462c41f58d148598fe70ad77070126a68aba4"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "web-time"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "web_atoms"
-version = "0.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba8b815c1b593dc0baf78dd0f4fc8fdb2de53198fb1163738093e9a311c33fb3"
-dependencies = [
- "phf",
- "phf_codegen",
- "string_cache",
- "string_cache_codegen",
-]
-
-[[package]]
-name = "webkit2gtk"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793"
-dependencies = [
- "bitflags 1.3.2",
- "cairo-rs",
- "gdk",
- "gdk-sys",
- "gio",
- "gio-sys",
- "glib",
- "glib-sys",
- "gobject-sys",
- "gtk",
- "gtk-sys",
- "javascriptcore-rs",
- "libc",
- "once_cell",
- "soup3",
- "webkit2gtk-sys",
-]
-
-[[package]]
-name = "webkit2gtk-sys"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5"
-dependencies = [
- "bitflags 1.3.2",
- "cairo-sys-rs",
- "gdk-sys",
- "gio-sys",
- "glib-sys",
- "gobject-sys",
- "gtk-sys",
- "javascriptcore-rs-sys",
- "libc",
- "pkg-config",
- "soup3-sys",
- "system-deps",
-]
-
-[[package]]
-name = "webpki-root-certs"
-version = "1.0.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58ec80e73fd8baf57bf0d9615554c75348bda990d6d5bbeab964dd068319fecb"
-dependencies = [
- "rustls-pki-types",
-]
-
-[[package]]
-name = "webpki-roots"
-version = "1.0.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c1c8e20c8a38fc7d65abfe74eb7280e4aa667e8eec8bc84996d2874810748d9"
-dependencies = [
- "rustls-pki-types",
-]
-
-[[package]]
-name = "webview2-com"
-version = "0.39.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f89fca7a704cee10dcb3654c1dbb8941d1783132f1917358af75bec37a7d7e6"
-dependencies = [
- "webview2-com-macros",
- "webview2-com-sys",
- "windows",
- "windows-core",
-]
-
-[[package]]
-name = "webview2-com-macros"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67a921c1b6914c367b2b823cd4cde6f96beec77d30a939c8199bb377cf9b9b54"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "webview2-com-sys"
-version = "0.39.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3a07132775117d6065853d9d1178157b8c90e228de47129d6bce2c7edebedfb"
-dependencies = [
- "thiserror 2.0.21",
- "windows",
- "windows-core",
-]
-
-[[package]]
-name = "whoami"
-version = "2.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "626c4bac6755d76ffc12cb01b2eac751db1996b9e0041de9aa02c8c211ddc82c"
-dependencies = [
- "libc",
- "libredox",
- "objc2-system-configuration",
- "wasite",
- "web-sys",
-]
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-util"
-version = "0.1.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
-dependencies = [
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "winauth"
-version = "0.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e03c9d0fde636447315ff38695b14c85c6ccc738ade05a400a3ce568a557021"
-dependencies = [
- "base64 0.10.1",
- "bitflags 1.3.2",
- "byteorder",
- "md5",
- "rand 0.7.3",
- "winapi",
-]
-
-[[package]]
-name = "window-vibrancy"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "111e51caca442cafd9bab396628ac4d814880eaea4e63dfd76a12e9f342b5580"
-dependencies = [
- "objc2",
- "objc2-app-kit",
- "objc2-core-foundation",
- "objc2-foundation",
- "objc2-quartz-core",
- "raw-window-handle",
- "windows-sys 0.61.2",
- "windows-version",
-]
-
-[[package]]
-name = "windows"
-version = "0.62.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"
-dependencies = [
- "windows-collections",
- "windows-core",
- "windows-future",
- "windows-numerics",
-]
-
-[[package]]
-name = "windows-collections"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"
-dependencies = [
- "windows-core",
-]
-
-[[package]]
-name = "windows-core"
-version = "0.62.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
-dependencies = [
- "windows-implement",
- "windows-interface",
- "windows-link",
- "windows-result",
- "windows-strings",
-]
-
-[[package]]
-name = "windows-future"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"
-dependencies = [
- "windows-core",
- "windows-link",
- "windows-threading",
-]
-
-[[package]]
-name = "windows-implement"
-version = "0.60.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "windows-interface"
-version = "0.59.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "windows-link"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
-
-[[package]]
-name = "windows-numerics"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"
-dependencies = [
- "windows-core",
- "windows-link",
-]
-
-[[package]]
-name = "windows-registry"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"
-dependencies = [
- "windows-link",
- "windows-result",
- "windows-strings",
-]
-
-[[package]]
-name = "windows-result"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-strings"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.45.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
-dependencies = [
- "windows-targets 0.42.2",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
-dependencies = [
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.60.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
-dependencies = [
- "windows-targets 0.53.5",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.61.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
-dependencies = [
- "windows_aarch64_gnullvm 0.42.2",
- "windows_aarch64_msvc 0.42.2",
- "windows_i686_gnu 0.42.2",
- "windows_i686_msvc 0.42.2",
- "windows_x86_64_gnu 0.42.2",
- "windows_x86_64_gnullvm 0.42.2",
- "windows_x86_64_msvc 0.42.2",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
-dependencies = [
- "windows_aarch64_gnullvm 0.52.6",
- "windows_aarch64_msvc 0.52.6",
- "windows_i686_gnu 0.52.6",
- "windows_i686_gnullvm 0.52.6",
- "windows_i686_msvc 0.52.6",
- "windows_x86_64_gnu 0.52.6",
- "windows_x86_64_gnullvm 0.52.6",
- "windows_x86_64_msvc 0.52.6",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.53.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
-dependencies = [
- "windows-link",
- "windows_aarch64_gnullvm 0.53.1",
- "windows_aarch64_msvc 0.53.1",
- "windows_i686_gnu 0.53.1",
- "windows_i686_gnullvm 0.53.1",
- "windows_i686_msvc 0.53.1",
- "windows_x86_64_gnu 0.53.1",
- "windows_x86_64_gnullvm 0.53.1",
- "windows_x86_64_msvc 0.53.1",
-]
-
-[[package]]
-name = "windows-threading"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-version"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
-
-[[package]]
-name = "winnow"
-version = "0.5.40"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "winnow"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "winreg"
-version = "0.56.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10"
-dependencies = [
- "cfg-if",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "wit-bindgen"
-version = "0.57.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
-
-[[package]]
-name = "writeable"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
-
-[[package]]
-name = "wry"
-version = "0.57.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a819957a01b3119af85e638a38d242af76dbc87d130dca67bfd0441072e21ff0"
-dependencies = [
- "base64 0.22.1",
- "block2",
- "cookie",
- "crossbeam-channel",
- "dirs",
- "dom_query",
- "dpi",
- "dunce",
- "gdkx11",
- "gtk",
- "http",
- "javascriptcore-rs",
- "jni 0.21.1",
- "libc",
- "ndk",
- "objc2",
- "objc2-app-kit",
- "objc2-core-foundation",
- "objc2-foundation",
- "objc2-ui-kit",
- "objc2-web-kit",
- "once_cell",
- "percent-encoding",
- "raw-window-handle",
- "sha2 0.10.9",
- "soup3",
- "tao-macros",
- "thiserror 2.0.21",
- "url",
- "webkit2gtk",
- "webkit2gtk-sys",
- "webview2-com",
- "windows",
- "windows-core",
- "windows-version",
- "x11-dl",
-]
-
-[[package]]
-name = "x11"
-version = "2.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e"
-dependencies = [
- "libc",
- "pkg-config",
-]
-
-[[package]]
-name = "x11-dl"
-version = "2.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f"
-dependencies = [
- "libc",
- "once_cell",
- "pkg-config",
-]
-
-[[package]]
-name = "x509-cert"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1301e935010a701ae5f8655edc0ad17c44bad3ac5ce8c39185f75453b720ae94"
-dependencies = [
- "const-oid 0.9.6",
- "der 0.7.10",
- "spki 0.7.3",
- "tls_codec",
-]
-
-[[package]]
-name = "xattr"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156"
-dependencies = [
- "libc",
- "rustix",
-]
-
-[[package]]
-name = "xxhash-rust"
-version = "0.8.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "550a2b930b62486a393c52d5c3b84bff264b28aa437ed64694d31e93b1757af7"
-
-[[package]]
-name = "yoke"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5"
-dependencies = [
- "stable_deref_trait",
- "yoke-derive",
- "zerofrom",
-]
-
-[[package]]
-name = "yoke-derive"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
- "synstructure",
-]
-
-[[package]]
-name = "zbus"
-version = "5.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907"
-dependencies = [
- "async-broadcast",
- "async-executor",
- "async-io",
- "async-lock",
- "async-process",
- "async-recursion",
- "async-task",
- "async-trait",
- "blocking",
- "enumflags2",
- "event-listener",
- "futures-core",
- "futures-lite",
- "hex",
- "libc",
- "ordered-stream",
- "rustix",
- "serde",
- "serde_repr",
- "tracing",
- "uds_windows",
- "uuid",
- "windows-sys 0.61.2",
- "winnow 1.0.4",
- "zbus_macros",
- "zbus_names",
- "zvariant",
-]
-
-[[package]]
-name = "zbus_macros"
-version = "5.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40"
-dependencies = [
- "proc-macro-crate 3.5.0",
- "proc-macro2",
- "quote",
- "syn 3.0.9",
- "zbus_names",
- "zvariant",
- "zvariant_utils",
-]
-
-[[package]]
-name = "zbus_names"
-version = "4.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd"
-dependencies = [
- "serde",
- "winnow 1.0.4",
- "zvariant",
-]
-
-[[package]]
-name = "zcheapstr"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d1afec51604565183aeb5c54c20aeab286120d4e4460f7f76e3e8bb8c0d99473"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "zerocopy"
-version = "0.8.63"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8"
-dependencies = [
- "zerocopy-derive",
-]
-
-[[package]]
-name = "zerocopy-derive"
-version = "0.8.63"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "zerofrom"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"
-dependencies = [
- "zerofrom-derive",
-]
-
-[[package]]
-name = "zerofrom-derive"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
- "synstructure",
-]
-
-[[package]]
-name = "zeroize"
-version = "1.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.119",
-]
-
-[[package]]
-name = "zerotrie"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"
-dependencies = [
- "displaydoc",
- "yoke",
- "zerofrom",
-]
-
-[[package]]
-name = "zerovec"
-version = "0.11.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8"
-dependencies = [
- "yoke",
- "zerofrom",
- "zerovec-derive",
-]
-
-[[package]]
-name = "zerovec-derive"
-version = "0.11.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.9",
-]
-
-[[package]]
-name = "zip"
-version = "9.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3476fd497ac8af5b1ec7b51acab7bef380f7e8dd8e0487595bafd839417a302"
-dependencies = [
- "constant_time_eq",
- "crc32fast",
- "getrandom 0.4.3",
- "indexmap 2.14.2",
- "libc",
- "memchr",
- "nix",
- "typed-path",
- "windows-sys 0.61.2",
- "zeroize",
-]
-
-[[package]]
-name = "zlib-rs"
-version = "0.6.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112"
-
-[[package]]
-name = "zmij"
-version = "1.0.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
-
-[[package]]
-name = "zvariant"
-version = "5.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80bf6d6cd6a4b601acb64cfb8284cdc643fcfa75ef26ae3c46ec8aa4e8a1fbb7"
-dependencies = [
- "endi",
- "enumflags2",
- "serde",
- "winnow 1.0.4",
- "zcheapstr",
- "zvariant_derive",
- "zvariant_utils",
-]
-
-[[package]]
-name = "zvariant_derive"
-version = "5.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d"
-dependencies = [
- "proc-macro-crate 3.5.0",
- "proc-macro2",
- "quote",
- "syn 3.0.9",
- "zvariant_utils",
-]
-
-[[package]]
-name = "zvariant_utils"
-version = "4.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bad0294361a320b694a328460dc73add56c306150f5cb6bfafc44446120008a3"
-dependencies = [
- "proc-macro2",
- "quote",
- "serde",
- "syn 3.0.9",
- "winnow 1.0.4",
-]
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
deleted file mode 100644
index 9132677..0000000
--- a/src-tauri/Cargo.toml
+++ /dev/null
@@ -1,75 +0,0 @@
-[package]
-name = "lowquery"
-version = "0.5.7"
-description = "Lightweight SQL client for multiple databases"
-authors = ["LowBloat"]
-license = "AGPL-3.0-only"
-repository = "https://github.com/LowBloat/LowQuery"
-edition = "2021"
-rust-version = "1.89"
-
-[lib]
-# The `_lib` suffix avoids a name clash between the binary and the library on Windows.
-name = "lowquery_lib"
-crate-type = ["staticlib", "cdylib", "rlib"]
-
-[build-dependencies]
-tauri-build = { version = "2", features = [] }
-
-[dependencies]
-tauri = { version = "2", features = [] }
-tauri-plugin-dialog = "2"
-tauri-plugin-updater = "2"
-tauri-plugin-process = "2"
-tauri-plugin-opener = "2"
-serde = { version = "1", features = ["derive"] }
-serde_json = { version = "1", features = ["preserve_order", "raw_value"] }
-tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "time", "net", "io-util", "io-std"] }
-thiserror = "2"
-uuid = { version = "1", features = ["v4", "serde"] }
-directories = "6"
-parking_lot = "0.12"
-chrono = { version = "0.4", default-features = false, features = ["std", "clock"] }
-# PostgreSQL: native async protocol, TLS via rustls.
-tokio-postgres = { version = "0.7", features = ["with-chrono-0_4", "with-serde_json-1", "with-uuid-1"] }
-tokio-postgres-rustls = "0.13"
-rustls = { version = "0.23", default-features = false, features = ["aws_lc_rs", "std", "tls12"] }
-webpki-roots = "1"
-rustls-native-certs = "0.8"
-futures-util = { version = "0.3", default-features = false, features = ["std"] }
-# Oracle: official pure-Rust driver (thin mode), no Oracle Client needed.
-oracledb = "=26.0.0-beta.4"
-# Passwords in the OS credential store.
-# MySQL and MariaDB: native protocol, TLS through rustls.
-mysql_async = { version = "0.37", default-features = false, features = ["default-rustls"] }
-# SQL Server: TDS protocol, TLS through rustls, named instances via SQL Browser.
-tiberius = { version = "0.13", default-features = false, features = ["tds80", "rustls", "sql-browser-tokio", "winauth"] }
-tokio-util = { version = "0.7", features = ["compat"] }
-# Redis: RESP protocol over tokio, TLS through rustls.
-redis = { version = "1.7", default-features = false, features = ["aio", "tokio-comp", "tokio-rustls-comp", "tls-rustls-insecure", "tls-rustls-webpki-roots"] }
-# Apache Cassandra: native CQL protocol (v4/v5), TLS through rustls.
-scylla = { version = "1.9", default-features = false, features = ["rustls-023"] }
-# SQLite: embedded engine compiled into the app.
-rusqlite = { version = "0.41", features = ["bundled", "column_decltype", "column_metadata"] }
-keyring = { version = "=3.6.3", features = ["apple-native", "windows-native", "sync-secret-service"] }
-# DBeaver import: credentials-config.json is AES-128-CBC.
-aes = "0.9"
-cbc = "0.2"
-# DataGrip and SQL Developer import: XML connection files.
-quick-xml = "0.42"
-
-# Oracle homes registered by Windows installers.
-[target.'cfg(windows)'.dependencies]
-winreg = "0.56"
-
-[profile.release]
-codegen-units = 1
-lto = true
-opt-level = 3
-panic = "abort"
-strip = true
-
-# oracledb 26.0.0-beta.4 with two parser fixes for duplicate-column bit vectors
-# (see vendor/oracledb/LOWQUERY.md). Remove once a release includes them.
-[patch.crates-io]
-oracledb = { path = "vendor/oracledb" }
diff --git a/src-tauri/build.rs b/src-tauri/build.rs
deleted file mode 100644
index d860e1e..0000000
--- a/src-tauri/build.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() {
- tauri_build::build()
-}
diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json
deleted file mode 100644
index 242d38f..0000000
--- a/src-tauri/capabilities/default.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "$schema": "../gen/schemas/desktop-schema.json",
- "identifier": "default",
- "description": "Main window permissions",
- "windows": [
- "main"
- ],
- "permissions": [
- "core:default",
- "core:window:allow-minimize",
- "core:window:allow-toggle-maximize",
- "core:window:allow-close",
- "core:window:allow-start-dragging",
- "dialog:allow-save",
- "dialog:allow-open",
- "updater:default",
- "process:allow-restart",
- "process:allow-exit",
- "opener:default"
- ]
-}
diff --git a/src-tauri/deny.toml b/src-tauri/deny.toml
deleted file mode 100644
index 36cc6f2..0000000
--- a/src-tauri/deny.toml
+++ /dev/null
@@ -1,30 +0,0 @@
-# cargo-deny configuration: `cargo deny --manifest-path src-tauri/Cargo.toml check advisories bans sources`
-# Run weekly and on dependency changes by .github/workflows/security.yml.
-
-[graph]
-all-features = false
-
-[advisories]
-# Known vulnerabilities always fail. Unmaintained notices are reported only for
-# crates we depend on directly; transitive ones (gtk/zbus stacks pulled in by
-# Tauri) are tracked through upstream updates.
-unmaintained = "workspace"
-yanked = "warn"
-ignore = [
- # zip < 9 extraction (SUID bits, symlinks out of the target, permissions
- # through symlinks). Only tauri-plugin-updater 2.14 (the latest) uses zip,
- # pinned to 4.x, and it unzips Windows update packages only after checking
- # their minisign signature against LowQuery's update key, so a crafted
- # archive needs that key. Drop these when the plugin moves to zip >= 9.
- { id = "RUSTSEC-2026-0367", reason = "zip via tauri-plugin-updater; packages are signature-checked before extraction" },
- { id = "RUSTSEC-2026-0368", reason = "zip via tauri-plugin-updater; packages are signature-checked before extraction" },
- { id = "RUSTSEC-2026-0369", reason = "zip via tauri-plugin-updater; packages are signature-checked before extraction" },
-]
-
-[bans]
-multiple-versions = "warn"
-wildcards = "deny"
-
-[sources]
-unknown-registry = "deny"
-unknown-git = "deny"
diff --git a/src-tauri/icons/64x64.png b/src-tauri/icons/64x64.png
deleted file mode 100644
index f129491..0000000
Binary files a/src-tauri/icons/64x64.png and /dev/null differ
diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png
deleted file mode 100644
index 3a21d84..0000000
Binary files a/src-tauri/icons/Square107x107Logo.png and /dev/null differ
diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png
deleted file mode 100644
index 2e1aba9..0000000
Binary files a/src-tauri/icons/Square142x142Logo.png and /dev/null differ
diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png
deleted file mode 100644
index 258c9f2..0000000
Binary files a/src-tauri/icons/Square150x150Logo.png and /dev/null differ
diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png
deleted file mode 100644
index 43ebc7c..0000000
Binary files a/src-tauri/icons/Square284x284Logo.png and /dev/null differ
diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png
deleted file mode 100644
index 71f5d4e..0000000
Binary files a/src-tauri/icons/Square30x30Logo.png and /dev/null differ
diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png
deleted file mode 100644
index 89769ae..0000000
Binary files a/src-tauri/icons/Square310x310Logo.png and /dev/null differ
diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png
deleted file mode 100644
index 417404e..0000000
Binary files a/src-tauri/icons/Square44x44Logo.png and /dev/null differ
diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png
deleted file mode 100644
index f198174..0000000
Binary files a/src-tauri/icons/Square71x71Logo.png and /dev/null differ
diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png
deleted file mode 100644
index 2432bc0..0000000
Binary files a/src-tauri/icons/Square89x89Logo.png and /dev/null differ
diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png
deleted file mode 100644
index a9554c0..0000000
Binary files a/src-tauri/icons/StoreLogo.png and /dev/null differ
diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png
deleted file mode 100644
index b743a82..0000000
Binary files a/src-tauri/icons/icon.png and /dev/null differ
diff --git a/src-tauri/icons/icon.svg b/src-tauri/icons/icon.svg
deleted file mode 100644
index 7086dbe..0000000
--- a/src-tauri/icons/icon.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src-tauri/src/ai_setup.rs b/src-tauri/src/ai_setup.rs
deleted file mode 100644
index 65dae6d..0000000
--- a/src-tauri/src/ai_setup.rs
+++ /dev/null
@@ -1,357 +0,0 @@
-//! Setting up AI clients to start `lowquery mcp`: the command to run, the
-//! configuration each client expects, and adding LowQuery to the JSON
-//! configuration files of the clients that have one.
-
-use std::path::{Path, PathBuf};
-
-use serde::Serialize;
-use serde_json::{json, Map, Value};
-
-use crate::error::{AppError, AppResult};
-
-/// Name of the server entry in client configurations.
-const SERVER_NAME: &str = "lowquery";
-
-#[derive(Debug, Clone, Serialize)]
-#[serde(rename_all = "camelCase")]
-pub struct AiSetup {
- /// Executable that runs the MCP server (` mcp`).
- pub command: String,
- pub args: Vec,
- pub clients: Vec,
-}
-
-#[derive(Debug, Clone, Serialize)]
-#[serde(rename_all = "camelCase")]
-pub struct AiClient {
- pub id: &'static str,
- pub name: &'static str,
- /// Configuration file LowQuery can update, when the client has one.
- pub config_path: Option,
- /// The client seems installed (its configuration folder exists).
- pub installed: bool,
- /// The configuration already starts this LowQuery.
- pub configured: bool,
- /// What to paste or run, for clients configured by hand.
- pub snippet: String,
- /// "json", "toml" or "shell", for highlighting.
- pub snippet_kind: &'static str,
-}
-
-/// How a client's JSON file lists servers.
-#[derive(Clone, Copy)]
-enum JsonStyle {
- /// `{ "mcpServers": { name: { command, args } } }` (Claude Desktop,
- /// Cursor, Windsurf, Gemini CLI).
- McpServers,
- /// `{ "servers": { name: { type: "stdio", command, args } } }` (VS Code).
- VsCode,
-}
-
-struct JsonClient {
- id: &'static str,
- name: &'static str,
- style: JsonStyle,
- /// Candidate files in order; the first whose folder exists is used.
- paths: Vec,
-}
-
-/// The executable to start. An AppImage runs from a temporary mount, so
-/// its own path (`$APPIMAGE`) is the stable one.
-pub fn server_command() -> AppResult {
- if let Ok(appimage) = std::env::var("APPIMAGE") {
- if !appimage.is_empty() {
- return Ok(appimage);
- }
- }
- let exe = std::env::current_exe()?;
- Ok(exe.display().to_string())
-}
-
-fn home() -> PathBuf {
- directories::BaseDirs::new()
- .map(|d| d.home_dir().to_path_buf())
- .unwrap_or_default()
-}
-
-fn config_root() -> PathBuf {
- directories::BaseDirs::new()
- .map(|d| d.config_dir().to_path_buf())
- .unwrap_or_default()
-}
-
-fn json_clients() -> Vec {
- let home = home();
- let config = config_root();
- let mut claude = Vec::new();
- // The Microsoft Store build keeps its files in a virtualized folder.
- if cfg!(windows) {
- if let Some(local) = directories::BaseDirs::new().map(|d| d.data_local_dir().to_path_buf())
- {
- if let Ok(entries) = std::fs::read_dir(local.join("Packages")) {
- for e in entries.flatten() {
- if e.file_name().to_string_lossy().starts_with("Claude_") {
- claude.push(
- e.path()
- .join("LocalCache/Roaming/Claude/claude_desktop_config.json"),
- );
- }
- }
- }
- }
- }
- claude.push(config.join("Claude").join("claude_desktop_config.json"));
- vec![
- JsonClient {
- id: "claude-desktop",
- name: "Claude Desktop",
- style: JsonStyle::McpServers,
- paths: claude,
- },
- JsonClient {
- id: "cursor",
- name: "Cursor",
- style: JsonStyle::McpServers,
- paths: vec![home.join(".cursor").join("mcp.json")],
- },
- JsonClient {
- id: "vscode",
- name: "VS Code",
- style: JsonStyle::VsCode,
- paths: vec![config.join("Code").join("User").join("mcp.json")],
- },
- JsonClient {
- id: "windsurf",
- name: "Windsurf",
- style: JsonStyle::McpServers,
- paths: vec![home
- .join(".codeium")
- .join("windsurf")
- .join("mcp_config.json")],
- },
- JsonClient {
- id: "gemini",
- name: "Gemini CLI",
- style: JsonStyle::McpServers,
- paths: vec![home.join(".gemini").join("settings.json")],
- },
- ]
-}
-
-fn pick_path(paths: &[PathBuf]) -> Option<&PathBuf> {
- paths
- .iter()
- .find(|p| p.parent().is_some_and(Path::exists))
- .or(paths.last())
-}
-
-fn entry(style: JsonStyle, command: &str) -> Value {
- match style {
- JsonStyle::McpServers => json!({ "command": command, "args": ["mcp"] }),
- JsonStyle::VsCode => json!({ "type": "stdio", "command": command, "args": ["mcp"] }),
- }
-}
-
-fn servers_key(style: JsonStyle) -> &'static str {
- match style {
- JsonStyle::McpServers => "mcpServers",
- JsonStyle::VsCode => "servers",
- }
-}
-
-fn snippet(style: JsonStyle, command: &str) -> String {
- let doc = json!({ servers_key(style): { SERVER_NAME: entry(style, command) } });
- serde_json::to_string_pretty(&doc).unwrap_or_default()
-}
-
-/// Whether the file's server entry already starts `command`.
-fn is_configured(path: &Path, style: JsonStyle, command: &str) -> bool {
- let Ok(text) = std::fs::read_to_string(path) else {
- return false;
- };
- let Ok(doc) = serde_json::from_str::(&text) else {
- return false;
- };
- doc.get(servers_key(style))
- .and_then(|s| s.get(SERVER_NAME))
- .and_then(|e| e.get("command"))
- .and_then(Value::as_str)
- .is_some_and(|c| c == command)
-}
-
-fn quote_shell(s: &str) -> String {
- if s.chars()
- .all(|c| c.is_ascii_alphanumeric() || "/\\:._-".contains(c))
- {
- s.to_string()
- } else {
- format!("\"{}\"", s.replace('"', "\\\""))
- }
-}
-
-fn toml_string(s: &str) -> String {
- format!("\"{}\"", s.replace('\\', "\\\\").replace('"', "\\\""))
-}
-
-pub fn setup() -> AppResult {
- let command = server_command()?;
- let mut clients: Vec = json_clients()
- .into_iter()
- .map(|c| {
- let path = pick_path(&c.paths).cloned();
- let installed = path
- .as_ref()
- .and_then(|p| p.parent())
- .is_some_and(Path::exists);
- AiClient {
- id: c.id,
- name: c.name,
- configured: path
- .as_ref()
- .is_some_and(|p| is_configured(p, c.style, &command)),
- config_path: path.map(|p| p.display().to_string()),
- installed,
- snippet: snippet(c.style, &command),
- snippet_kind: "json",
- }
- })
- .collect();
- let shell_cmd = quote_shell(&command);
- clients.insert(
- 1,
- AiClient {
- id: "claude-code",
- name: "Claude Code",
- config_path: None,
- installed: home().join(".claude").exists(),
- configured: false,
- snippet: format!("claude mcp add --scope user {SERVER_NAME} -- {shell_cmd} mcp"),
- snippet_kind: "shell",
- },
- );
- clients.push(AiClient {
- id: "codex",
- name: "Codex",
- config_path: None,
- installed: home().join(".codex").exists(),
- configured: false,
- snippet: format!(
- "[mcp_servers.{SERVER_NAME}]\ncommand = {}\nargs = [\"mcp\"]",
- toml_string(&command)
- ),
- snippet_kind: "toml",
- });
- Ok(AiSetup {
- command,
- args: vec!["mcp".into()],
- clients,
- })
-}
-
-/// Adds (or updates) the LowQuery entry in a client's JSON configuration,
-/// keeping everything else. The previous file is kept as
-/// `.lowquery-backup`.
-pub fn connect_client(id: &str) -> AppResult {
- let command = server_command()?;
- let client = json_clients()
- .into_iter()
- .find(|c| c.id == id)
- .ok_or_else(|| AppError::invalid("This client is configured by hand."))?;
- let path = pick_path(&client.paths)
- .cloned()
- .ok_or_else(|| AppError::invalid("Could not find the client configuration folder."))?;
- write_entry(&path, client.style, &command)?;
- Ok(path.display().to_string())
-}
-
-fn write_entry(path: &Path, style: JsonStyle, command: &str) -> AppResult<()> {
- let mut doc = match std::fs::read_to_string(path) {
- Ok(text) if text.trim().is_empty() => Value::Object(Map::new()),
- Ok(text) => {
- let text = text.trim_start_matches('\u{feff}');
- serde_json::from_str::(text).map_err(|_| {
- AppError::invalid(
- "The configuration file is not plain JSON (it may have comments). Add the snippet by hand.",
- )
- })?
- }
- Err(e) if e.kind() == std::io::ErrorKind::NotFound => Value::Object(Map::new()),
- Err(e) => return Err(e.into()),
- };
- let root = doc
- .as_object_mut()
- .ok_or_else(|| AppError::invalid("The configuration file does not hold a JSON object."))?;
- let servers = root
- .entry(servers_key(style))
- .or_insert_with(|| Value::Object(Map::new()));
- let servers = servers.as_object_mut().ok_or_else(|| {
- AppError::invalid("The servers section of the configuration is not an object.")
- })?;
- servers.insert(SERVER_NAME.into(), entry(style, command));
- if path.exists() {
- let mut backup = path.as_os_str().to_owned();
- backup.push(".lowquery-backup");
- std::fs::copy(path, PathBuf::from(backup))?;
- } else if let Some(dir) = path.parent() {
- std::fs::create_dir_all(dir)?;
- }
- let tmp = path.with_extension("lowquery-tmp");
- std::fs::write(&tmp, serde_json::to_string_pretty(&doc)? + "\n")?;
- std::fs::rename(&tmp, path)?;
- Ok(())
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn adds_entry_and_keeps_the_rest() {
- let dir = std::env::temp_dir().join(format!("lq-ai-{}", uuid::Uuid::new_v4()));
- std::fs::create_dir_all(&dir).unwrap();
- let path = dir.join("claude_desktop_config.json");
- std::fs::write(
- &path,
- r#"{"theme":"dark","mcpServers":{"other":{"command":"x"}},"zeta":1}"#,
- )
- .unwrap();
- write_entry(
- &path,
- JsonStyle::McpServers,
- r"C:\Apps\LowQuery\lowquery.exe",
- )
- .unwrap();
- let doc: Value = serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();
- let keys: Vec<&String> = doc.as_object().unwrap().keys().collect();
- assert_eq!(keys, ["theme", "mcpServers", "zeta"]);
- assert_eq!(doc["mcpServers"]["other"]["command"], "x");
- assert_eq!(doc["mcpServers"]["lowquery"]["args"][0], "mcp");
- assert!(is_configured(
- &path,
- JsonStyle::McpServers,
- r"C:\Apps\LowQuery\lowquery.exe"
- ));
- assert!(dir
- .join("claude_desktop_config.json.lowquery-backup")
- .exists());
-
- let vs = dir.join("mcp.json");
- write_entry(&vs, JsonStyle::VsCode, "/usr/bin/lowquery").unwrap();
- let doc: Value = serde_json::from_str(&std::fs::read_to_string(&vs).unwrap()).unwrap();
- assert_eq!(doc["servers"]["lowquery"]["type"], "stdio");
-
- std::fs::write(&vs, "{ // comment\n}").unwrap();
- assert!(write_entry(&vs, JsonStyle::VsCode, "x").is_err());
- let _ = std::fs::remove_dir_all(&dir);
- }
-
- #[test]
- fn snippets_quote_paths() {
- assert_eq!(quote_shell("/usr/bin/lowquery"), "/usr/bin/lowquery");
- assert_eq!(
- quote_shell(r"C:\Program Files\LowQuery\lowquery.exe"),
- r#""C:\Program Files\LowQuery\lowquery.exe""#
- );
- assert_eq!(toml_string(r"C:\a"), r#""C:\\a""#);
- }
-}
diff --git a/src-tauri/src/drivers/cassandra.rs b/src-tauri/src/drivers/cassandra.rs
deleted file mode 100644
index 53d1979..0000000
--- a/src-tauri/src/drivers/cassandra.rs
+++ /dev/null
@@ -1,2619 +0,0 @@
-//! Apache Cassandra session over the native CQL protocol, through the
-//! `scylla` driver (it speaks to Apache Cassandra 3.x, 4.x and 5.x as well).
-//!
-//! - Every statement is sent unprepared as text, like cqlsh does. Rows are
-//! read with paging: the page size comes from the row limit and reading
-//! stops at `max_rows + 1`, so a `SELECT` on a big table never streams
-//! everything to show a few rows.
-//! - Values keep their exact CQL text (`varint` and `decimal` keep every
-//! digit, floats are shortest round-trip, blobs are `0x...`). Collections,
-//! tuples, UDTs and vectors are written as valid CQL literals, so a cell can
-//! be pasted into an `INSERT` or `UPDATE` as it is.
-//! - There are no transactions: the session is always in autocommit mode and
-//! `BEGIN BATCH ... APPLY BATCH` is just one statement. Saving edits from
-//! the grid sends one logged batch.
-//! - CQL has no server-side cancel. `cancel` drops the request future, so the
-//! interface gets its answer at once, but the coordinator keeps working
-//! until its own request timeout.
-//! - Server warnings (tombstone thresholds, large batches, aggregations
-//! without a partition key) arrive as messages, like PostgreSQL notices.
-//! - Requests run at consistency `LOCAL_ONE`, the cqlsh default. TLS uses
-//! rustls; with the local datacenter set, only its nodes get requests.
-//! - The schema comes from `system_schema` (and `system_virtual_schema` for
-//! the virtual keyspaces of 4.0+), which every 3.0+ server has.
-//! `DESCRIBE` is a cqlsh command, not part of the protocol, so the CREATE
-//! statements are built from the catalog.
-
-use std::collections::HashMap;
-use std::fmt::Write as _;
-use std::sync::atomic::{AtomicBool, Ordering};
-use std::sync::Arc;
-use std::time::{Duration, Instant};
-
-use futures_util::StreamExt;
-use parking_lot::Mutex;
-use rustls::client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier};
-use rustls::client::WebPkiServerVerifier;
-use rustls::pki_types::{CertificateDer, ServerName, UnixTime};
-use rustls::{CertificateError, DigitallySignedStruct, SignatureScheme};
-use scylla::client::execution_profile::ExecutionProfile;
-use scylla::client::session::Session as Cql;
-use scylla::client::session_builder::SessionBuilder;
-use scylla::errors::{
- DbError, ExecutionError, IntoRowsResultError, NewSessionError, NextPageError, NextRowError,
- PagerExecutionError, RequestAttemptError, RequestError,
-};
-use scylla::frame::response::result::{CollectionType, ColumnType, NativeType};
-use scylla::policies::load_balancing::DefaultPolicy;
-use scylla::response::PagingState;
-use scylla::statement::{Consistency, Statement};
-use scylla::value::{CqlValue, Row};
-use tokio::sync::Notify;
-
-use super::{first_keywords, RowSink, StreamEvent, TxState, STREAM_BATCH};
-use crate::error::{AppError, AppResult, ErrorKind};
-use crate::model::{
- ApplyRequest, ApplyResult, ColumnInfo, ConnectionProfile, DbColumn, DbObject, EditColumn,
- EditTarget, ExecRequest, ExecResult, RowChange, SslMode, ValueKind,
-};
-
-const DEFAULT_PORT: u16 = 9042;
-const CONNECT_TIMEOUT: Duration = Duration::from_secs(10);
-/// TLS attempt of `prefer`: a server without TLS gives up early and the
-/// session falls back to plain TCP.
-const PREFER_TLS_TIMEOUT: Duration = Duration::from_secs(8);
-/// Largest page asked for in one request.
-const PAGE_CAP: usize = 5000;
-/// Page size of the catalog queries.
-const CATALOG_PAGE: i32 = 1000;
-const BINARY_PREVIEW_BYTES: usize = 32 * 1024;
-
-/// Keyspaces that belong to the server, listed after the user's.
-const SYSTEM_KEYSPACES: &[&str] = &[
- "system",
- "system_schema",
- "system_auth",
- "system_distributed",
- "system_traces",
- "system_views",
- "system_virtual_schema",
-];
-const VIRTUAL_KEYSPACES: &[&str] = &["system_views", "system_virtual_schema"];
-
-pub struct CassSession {
- cql: Cql,
- busy: AtomicBool,
- cancel: Arc,
- /// Key information per table, for result editing. Cleared by any
- /// statement that is not a SELECT.
- tables: Mutex>>,
- pub server_version: String,
- pub current_user: Option,
- pub current_schema: Option,
-}
-
-pub async fn connect(
- profile: &ConnectionProfile,
- password: Option<&str>,
-) -> AppResult {
- // rustls has more than one crypto provider compiled in.
- let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();
-
- let port = if profile.port == 0 {
- DEFAULT_PORT
- } else {
- profile.port
- };
- let contact_points: Vec = profile
- .host
- .split(',')
- .map(str::trim)
- .filter(|h| !h.is_empty())
- .map(|h| contact_point(h, port))
- .collect();
- if contact_points.is_empty() {
- return Err(AppError::invalid("Enter at least one contact point."));
- }
-
- let build = |tls: Option>| {
- let mut builder = SessionBuilder::new()
- .known_nodes(&contact_points)
- .connection_timeout(CONNECT_TIMEOUT)
- .fetch_schema_metadata(false)
- .default_execution_profile_handle(execution_profile(&profile.datacenter));
- let keyspace = profile.database.trim();
- if !keyspace.is_empty() {
- builder = builder.use_keyspace(keyspace, true);
- }
- let user = profile.user.trim();
- if !user.is_empty() {
- builder = builder.user(user, password.unwrap_or_default());
- }
- if let Some(config) = tls {
- builder = builder.tls_context(Some(config));
- }
- async move { builder.build().await }
- };
-
- let cql = match profile.ssl_mode {
- SslMode::Disable => build(None).await,
- SslMode::Prefer => {
- let attempt = tokio::time::timeout(
- PREFER_TLS_TIMEOUT,
- build(Some(tls_config(SslMode::Prefer)?)),
- )
- .await;
- match attempt {
- Ok(Ok(cql)) => Ok(cql),
- Ok(Err(e)) if is_auth_text(&chain(&e)) => Err(e),
- _ => build(None).await,
- }
- }
- SslMode::Require => build(Some(tls_config(SslMode::Require)?)).await,
- SslMode::VerifyFull => build(Some(tls_config(SslMode::VerifyFull)?)).await,
- }
- .map_err(connect_error)?;
-
- let version = fetch(&cql, "SELECT release_version FROM system.local")
- .await
- .ok()
- .and_then(|f| f.rows.into_iter().next())
- .and_then(|mut r| r.pop().flatten())
- .and_then(|v| text_of(&Some(v)));
- let user = profile.user.trim();
- Ok(CassSession {
- current_schema: cql.get_keyspace().map(|k| (*k).clone()),
- cql,
- busy: AtomicBool::new(false),
- cancel: Arc::new(Notify::new()),
- tables: Mutex::new(HashMap::new()),
- server_version: match version {
- Some(v) => format!("Apache Cassandra {v}"),
- None => "Apache Cassandra".into(),
- },
- current_user: (!user.is_empty()).then(|| user.to_string()),
- })
-}
-
-/// `host` or `host:port` as the driver wants it; a bare IPv6 address is
-/// bracketed.
-fn contact_point(host: &str, default_port: u16) -> String {
- if host.starts_with('[') {
- return if host.contains("]:") {
- host.to_string()
- } else {
- format!("{host}:{default_port}")
- };
- }
- match host.matches(':').count() {
- 0 => format!("{host}:{default_port}"),
- 1 => host.to_string(),
- _ => format!("[{host}]:{default_port}"),
- }
-}
-
-/// Requests go to the local datacenter only, when one is named.
-fn execution_profile(
- datacenter: &str,
-) -> scylla::client::execution_profile::ExecutionProfileHandle {
- let mut policy = DefaultPolicy::builder();
- let dc = datacenter.trim();
- if !dc.is_empty() {
- policy = policy
- .prefer_datacenter(dc.to_string())
- .permit_dc_failover(false);
- }
- ExecutionProfile::builder()
- .load_balancing_policy(policy.build())
- .consistency(Consistency::LocalOne)
- // The server's own timeouts apply; Cancel stops waiting.
- .request_timeout(None)
- .build()
- .into_handle()
-}
-
-// ---------------------------------------------------------------------------
-// TLS
-
-fn tls_config(mode: SslMode) -> AppResult> {
- if mode != SslMode::VerifyFull {
- // `prefer` and `require` encrypt without validating the certificate,
- // as everywhere else in the app.
- return super::postgres::tls_config(mode).map(Arc::new);
- }
- let provider = Arc::new(rustls::crypto::aws_lc_rs::default_provider());
- let mut roots = rustls::RootCertStore::empty();
- roots.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
- for cert in rustls_native_certs::load_native_certs().certs {
- let _ = roots.add(cert);
- }
- let inner = WebPkiServerVerifier::builder_with_provider(Arc::new(roots), provider.clone())
- .build()
- .map_err(|e| AppError::internal(e.to_string()))?;
- let config = rustls::ClientConfig::builder_with_provider(provider)
- .with_safe_default_protocol_versions()
- .map_err(|e| AppError::internal(e.to_string()))?
- .dangerous()
- .with_custom_certificate_verifier(Arc::new(ChainVerifier(inner)))
- .with_no_client_auth();
- Ok(Arc::new(config))
-}
-
-/// Validates the chain, expiry and signatures against the trusted roots but
-/// not the host name: the driver connects to the addresses the cluster
-/// reports (`system.peers`), which certificates rarely list.
-#[derive(Debug)]
-struct ChainVerifier(Arc);
-
-impl ServerCertVerifier for ChainVerifier {
- fn verify_server_cert(
- &self,
- end_entity: &CertificateDer<'_>,
- intermediates: &[CertificateDer<'_>],
- server_name: &ServerName<'_>,
- ocsp_response: &[u8],
- now: UnixTime,
- ) -> Result {
- match self
- .0
- .verify_server_cert(end_entity, intermediates, server_name, ocsp_response, now)
- {
- Err(rustls::Error::InvalidCertificate(
- CertificateError::NotValidForName | CertificateError::NotValidForNameContext { .. },
- )) => Ok(ServerCertVerified::assertion()),
- other => other,
- }
- }
-
- fn verify_tls12_signature(
- &self,
- message: &[u8],
- cert: &CertificateDer<'_>,
- dss: &DigitallySignedStruct,
- ) -> Result {
- self.0.verify_tls12_signature(message, cert, dss)
- }
-
- fn verify_tls13_signature(
- &self,
- message: &[u8],
- cert: &CertificateDer<'_>,
- dss: &DigitallySignedStruct,
- ) -> Result {
- self.0.verify_tls13_signature(message, cert, dss)
- }
-
- fn supported_verify_schemes(&self) -> Vec {
- self.0.supported_verify_schemes()
- }
-}
-
-// ---------------------------------------------------------------------------
-// Queries
-
-/// Rows of a catalog query, values as the driver decoded them.
-struct Fetched {
- names: Vec,
- rows: Vec>>,
-}
-
-impl Fetched {
- fn index(&self, name: &str) -> Option {
- self.names.iter().position(|n| n == name)
- }
-
- fn get<'a>(&self, row: &'a [Option], name: &str) -> Option<&'a CqlValue> {
- self.index(name)
- .and_then(|i| row.get(i))
- .and_then(Option::as_ref)
- }
-
- fn text(&self, row: &[Option], name: &str) -> Option {
- self.index(name).and_then(|i| row.get(i)).and_then(text_of)
- }
-}
-
-fn text_of(v: &Option) -> Option {
- match v {
- Some(CqlValue::Text(s) | CqlValue::Ascii(s)) => Some(s.clone()),
- _ => None,
- }
-}
-
-fn text_list(v: Option<&CqlValue>) -> Vec {
- match v {
- Some(CqlValue::List(items) | CqlValue::Set(items)) => items
- .iter()
- .filter_map(|i| text_of(&Some(i.clone())))
- .collect(),
- _ => Vec::new(),
- }
-}
-
-/// Runs a catalog statement and reads every page.
-async fn fetch(cql: &Cql, sql: &str) -> AppResult {
- let mut names;
- let mut rows = Vec::new();
- let mut state = PagingState::start();
- loop {
- let statement = Statement::new(sql).with_page_size(CATALOG_PAGE);
- let (result, flow) = cql
- .query_single_page(statement, &[], state)
- .await
- .map_err(|e| map_execution(e, Some(sql)))?;
- let page = result.into_rows_result().map_err(|e| match e {
- IntoRowsResultError::ResultNotRows(_) => {
- AppError::internal("The catalog statement returned no rows.")
- }
- other => AppError::internal(other.to_string()),
- })?;
- names = page
- .column_specs()
- .iter()
- .map(|c| c.name().to_string())
- .collect();
- for row in page
- .rows::()
- .map_err(|e| AppError::internal(e.to_string()))?
- {
- rows.push(row.map_err(|e| AppError::internal(e.to_string()))?.columns);
- }
- match flow.into_paging_control_flow() {
- std::ops::ControlFlow::Break(()) => break,
- std::ops::ControlFlow::Continue(next) => state = next,
- }
- }
- Ok(Fetched { names, rows })
-}
-
-/// Names a catalog query matches on, as a CQL string literal.
-fn lit(s: &str) -> String {
- format!("'{}'", s.replace('\'', "''"))
-}
-
-fn is_virtual(keyspace: &str) -> bool {
- VIRTUAL_KEYSPACES.contains(&keyspace)
-}
-
-fn is_system(keyspace: &str) -> bool {
- SYSTEM_KEYSPACES.contains(&keyspace) || keyspace.starts_with("system_")
-}
-
-/// One result column: what the editor needs to know about its origin.
-struct ResultColumn {
- name: String,
- keyspace: String,
- table: String,
-}
-
-struct TableMeta {
- columns: Vec,
- view: bool,
-}
-
-impl CassSession {
- /// Cassandra 3.x, whose table options differ from 4.0 and later.
- fn legacy(&self) -> bool {
- self.server_version.starts_with("Apache Cassandra 3.")
- }
-
- pub fn tx_state(&self) -> TxState {
- TxState {
- autocommit: true,
- in_transaction: false,
- }
- }
-
- pub async fn execute(&self, req: &ExecRequest) -> AppResult {
- self.busy.store(true, Ordering::SeqCst);
- let cancelled = self.cancel.notified();
- tokio::pin!(cancelled);
- cancelled.as_mut().enable();
- let outcome = tokio::select! {
- r = self.run(req) => r,
- () = &mut cancelled => Err(AppError::new(ErrorKind::Cancelled, "Cancelled.")),
- };
- self.busy.store(false, Ordering::SeqCst);
- outcome
- }
-
- /// CQL cannot ask the server to stop a request: the wait ends here and the
- /// coordinator finishes (or times out) on its own.
- pub async fn cancel(&self) -> AppResult<()> {
- if self.busy.load(Ordering::SeqCst) {
- self.cancel.notify_waiters();
- }
- Ok(())
- }
-
- pub async fn set_autocommit(&self, on: bool) -> AppResult {
- if on {
- Ok(self.tx_state())
- } else {
- Err(AppError::invalid(
- "Cassandra has no transactions: every statement commits on its own.",
- ))
- }
- }
-
- pub async fn end_transaction(&self, _commit: bool) -> AppResult {
- Err(AppError::invalid(
- "Cassandra has no transactions: every statement commits on its own.",
- ))
- }
-
- async fn run(&self, req: &ExecRequest) -> AppResult {
- let started = Instant::now();
- let sql = req.sql.as_str();
- let limit = req.max_rows;
- let mut result = ExecResult::default();
- let mut columns: Option> = None;
- let mut origins: Vec = Vec::new();
- let mut rows: Vec>> = Vec::new();
- let mut state = PagingState::start();
- loop {
- let size = if limit == 0 {
- PAGE_CAP
- } else {
- (limit + 1 - rows.len().min(limit + 1)).clamp(1, PAGE_CAP)
- };
- let statement = Statement::new(sql).with_page_size(size as i32);
- let (page, flow) = self
- .cql
- .query_single_page(statement, &[], state)
- .await
- .map_err(|e| map_execution(e, Some(sql)))?;
- match page.into_rows_result() {
- Ok(page) => {
- for w in page.warnings() {
- result.notices.push(format!("WARNING: {w}"));
- }
- if columns.is_none() {
- columns = Some(
- page.column_specs()
- .iter()
- .map(|c| ColumnInfo {
- name: c.name().to_string(),
- type_name: type_name(c.typ()),
- kind: column_kind(c.typ()),
- })
- .collect(),
- );
- origins = page
- .column_specs()
- .iter()
- .map(|c| ResultColumn {
- name: c.name().to_string(),
- keyspace: c.table_spec().ks_name().to_string(),
- table: c.table_spec().table_name().to_string(),
- })
- .collect();
- }
- let iter = page
- .rows::()
- .map_err(|e| AppError::internal(e.to_string()))?;
- for row in iter {
- let row = row.map_err(|e| AppError::internal(e.to_string()))?;
- rows.push(row.columns.iter().map(cell).collect());
- }
- }
- Err(IntoRowsResultError::ResultNotRows(page)) => {
- for w in page.warnings() {
- result.notices.push(format!("WARNING: {w}"));
- }
- break;
- }
- Err(e) => return Err(AppError::internal(e.to_string())),
- }
- if limit > 0 && rows.len() > limit {
- break;
- }
- match flow.into_paging_control_flow() {
- std::ops::ControlFlow::Break(()) => break,
- std::ops::ControlFlow::Continue(next) => state = next,
- }
- }
- if limit > 0 && rows.len() > limit {
- rows.truncate(limit);
- result.truncated = true;
- }
-
- let is_select = first_keywords(sql, 1).first().map(String::as_str) == Some("SELECT");
- if !is_select {
- self.tables.lock().clear();
- }
- if let Some(cols) = columns {
- let (editable, reason) = self.editable(sql, is_select, &origins).await;
- result.editable = editable;
- result.read_only_reason = reason;
- result.columns = Some(cols);
- result.rows = rows;
- }
- result.elapsed_ms = started.elapsed().as_millis() as u64;
- Ok(result)
- }
-
- pub async fn list_schemas(&self) -> AppResult> {
- let mut names: Vec = fetch(
- &self.cql,
- "SELECT keyspace_name FROM system_schema.keyspaces",
- )
- .await?
- .rows
- .into_iter()
- .filter_map(|mut r| r.pop().and_then(|v| text_of(&v)))
- .collect();
- // Virtual keyspaces exist from Cassandra 4.0.
- if let Ok(f) = fetch(
- &self.cql,
- "SELECT keyspace_name FROM system_virtual_schema.keyspaces",
- )
- .await
- {
- names.extend(
- f.rows
- .into_iter()
- .filter_map(|mut r| r.pop().and_then(|v| text_of(&v))),
- );
- }
- names.sort();
- names.dedup();
- names.sort_by_key(|n| is_system(n));
- Ok(names)
- }
-
- pub async fn list_objects(&self, schema: &str) -> AppResult> {
- let ks = lit(schema);
- let mut out = Vec::new();
- let mut add = |kind: &str, names: Vec| {
- let mut names = names;
- names.sort();
- out.extend(names.into_iter().map(|name| DbObject {
- name,
- kind: kind.into(),
- }));
- };
- let names_of = |f: Fetched, column: &str| -> Vec {
- f.rows.iter().filter_map(|r| f.text(r, column)).collect()
- };
- if is_virtual(schema) {
- let f = fetch(
- &self.cql,
- &format!(
- "SELECT table_name FROM system_virtual_schema.tables WHERE keyspace_name = {ks}"
- ),
- )
- .await?;
- add("table", names_of(f, "table_name"));
- return Ok(out);
- }
- let f = fetch(
- &self.cql,
- &format!("SELECT table_name FROM system_schema.tables WHERE keyspace_name = {ks}"),
- )
- .await?;
- add("table", names_of(f, "table_name"));
- let f = fetch(
- &self.cql,
- &format!("SELECT view_name FROM system_schema.views WHERE keyspace_name = {ks}"),
- )
- .await?;
- add("matview", names_of(f, "view_name"));
- let f = fetch(
- &self.cql,
- &format!("SELECT type_name FROM system_schema.types WHERE keyspace_name = {ks}"),
- )
- .await?;
- add("type", names_of(f, "type_name"));
- for (kind, table, column) in [
- ("function", "functions", "function_name"),
- ("aggregate", "aggregates", "aggregate_name"),
- ] {
- let f = fetch(
- &self.cql,
- &format!(
- "SELECT {column}, argument_types FROM system_schema.{table} WHERE keyspace_name = {ks}"
- ),
- )
- .await?;
- let names = f
- .rows
- .iter()
- .filter_map(|r| {
- let name = f.text(r, column)?;
- Some(format!(
- "{name}({})",
- text_list(f.get(r, "argument_types")).join(", ")
- ))
- })
- .collect();
- add(kind, names);
- }
- let f = fetch(
- &self.cql,
- &format!("SELECT index_name FROM system_schema.indexes WHERE keyspace_name = {ks}"),
- )
- .await?;
- add("index", names_of(f, "index_name"));
- Ok(out)
- }
-
- pub async fn list_columns(&self, schema: &str, table: &str) -> AppResult> {
- let (ks, t) = (lit(schema), lit(table));
- let f = if is_virtual(schema) {
- fetch(
- &self.cql,
- &format!(
- "SELECT column_name, type, kind, position FROM system_virtual_schema.columns \
- WHERE keyspace_name = {ks} AND table_name = {t}"
- ),
- )
- .await?
- } else {
- fetch(
- &self.cql,
- &format!(
- "SELECT column_name, type, kind, position FROM system_schema.columns \
- WHERE keyspace_name = {ks} AND table_name = {t}"
- ),
- )
- .await?
- };
- let mut cols: Vec<(u8, i32, DbColumn)> = f
- .rows
- .iter()
- .filter_map(|r| {
- let name = f.text(r, "column_name")?;
- let kind = f.text(r, "kind").unwrap_or_default().to_ascii_lowercase();
- let position = match f.get(r, "position") {
- Some(CqlValue::Int(p)) => *p,
- _ => 0,
- };
- let (order, role) = match kind.as_str() {
- "partition_key" => (0, "partition"),
- "clustering" => (1, "clustering"),
- "static" => (2, "static"),
- _ => (3, "regular"),
- };
- let key = order < 2;
- Some((
- order,
- if key { position } else { 0 },
- DbColumn {
- name,
- type_name: f.text(r, "type").unwrap_or_default(),
- nullable: !key,
- primary_key: key,
- default_value: None,
- key_role: Some(role.into()),
- },
- ))
- })
- .collect();
- cols.sort_by(|a, b| (a.0, a.1, &a.2.name).cmp(&(b.0, b.1, &b.2.name)));
- Ok(cols.into_iter().map(|c| c.2).collect())
- }
-
- /// Runs a query and sends its rows to `sink` in batches, one page at a time.
- pub async fn stream(&self, sql: &str, sink: RowSink) -> AppResult {
- let statement = Statement::new(sql).with_page_size(STREAM_BATCH as i32);
- let pager = self
- .cql
- .query_iter(statement, &[])
- .await
- .map_err(map_pager)?;
- let info: Vec = pager
- .column_specs()
- .iter()
- .map(|c| ColumnInfo {
- name: c.name().to_string(),
- type_name: type_name(c.typ()),
- kind: column_kind(c.typ()),
- })
- .collect();
- if info.is_empty() {
- return Err(AppError::invalid("The statement returns no rows."));
- }
- sink.send(StreamEvent::Columns(info))
- .await
- .map_err(|_| super::stream_stopped())?;
- let mut rows = pager
- .rows_stream::()
- .map_err(|e| AppError::internal(e.to_string()))?;
- let mut total = 0u64;
- let mut batch = Vec::with_capacity(STREAM_BATCH);
- while let Some(row) = rows.next().await {
- let row = row.map_err(map_next_row)?;
- batch.push(super::full_values(|| {
- row.columns.iter().map(cell).collect::>()
- }));
- total += 1;
- if batch.len() == STREAM_BATCH {
- let full = std::mem::replace(&mut batch, Vec::with_capacity(STREAM_BATCH));
- sink.send(StreamEvent::Rows(full))
- .await
- .map_err(|_| super::stream_stopped())?;
- }
- }
- if !batch.is_empty() {
- sink.send(StreamEvent::Rows(batch))
- .await
- .map_err(|_| super::stream_stopped())?;
- }
- Ok(total)
- }
-
- // -----------------------------------------------------------------------
- // Result editing
-
- /// The table behind a result, when each row can be addressed by its full
- /// primary key.
- async fn editable(
- &self,
- sql: &str,
- is_select: bool,
- origins: &[ResultColumn],
- ) -> (Option, Option) {
- let reason = |text: &str| (None, Some(text.to_string()));
- if !is_select {
- return reason("Only the rows of a SELECT can be edited.");
- }
- let Some(first) = origins.first() else {
- return reason("The result has no columns.");
- };
- if origins
- .iter()
- .any(|c| (&c.keyspace, &c.table) != (&first.keyspace, &first.table))
- {
- return reason("The result does not come from a single table.");
- }
- if is_system(&first.keyspace) {
- return reason("System tables are read-only.");
- }
- if has_alias(sql) {
- return reason("Columns with an alias (AS) cannot be matched to the table.");
- }
- let meta = match self.table_meta(&first.keyspace, &first.table).await {
- Ok(m) => m,
- Err(_) => return reason("The table's key could not be read."),
- };
- if meta.view {
- return reason("Materialized views cannot be edited.");
- }
- if meta.columns.iter().any(|c| c.type_name == "counter") {
- return reason("Counter tables cannot be edited in the grid.");
- }
- let mut key = Vec::new();
- let mut missing = Vec::new();
- for c in meta.columns.iter().filter(|c| c.primary_key) {
- match origins.iter().position(|o| o.name == c.name) {
- Some(i) => key.push(i),
- None => missing.push(quote_name(&c.name)),
- }
- }
- if key.is_empty() && missing.is_empty() {
- return reason("The table has no primary key.");
- }
- if !missing.is_empty() {
- return reason(&format!(
- "The result must include the whole primary key (missing {}).",
- missing.join(", ")
- ));
- }
- let columns = origins
- .iter()
- .map(|o| {
- meta.columns
- .iter()
- .find(|c| c.name == o.name)
- .map(|c| EditColumn {
- name: c.name.clone(),
- type_name: c.type_name.clone(),
- })
- })
- .collect();
- (
- Some(EditTarget {
- schema: Some(first.keyspace.clone()),
- table: first.table.clone(),
- columns,
- key,
- }),
- None,
- )
- }
-
- async fn table_meta(&self, keyspace: &str, table: &str) -> AppResult> {
- let id = (keyspace.to_string(), table.to_string());
- if let Some(m) = self.tables.lock().get(&id) {
- return Ok(m.clone());
- }
- let columns = self.list_columns(keyspace, table).await?;
- let views = fetch(
- &self.cql,
- &format!(
- "SELECT view_name FROM system_schema.views WHERE keyspace_name = {} AND view_name = {}",
- lit(keyspace),
- lit(table)
- ),
- )
- .await?;
- let meta = Arc::new(TableMeta {
- columns,
- view: !views.rows.is_empty(),
- });
- self.tables.lock().insert(id, meta.clone());
- Ok(meta)
- }
-
- /// Saves the grid's changes as one logged batch, which Cassandra applies
- /// completely or not at all. CQL writes are upserts, so an UPDATE or
- /// DELETE whose row was removed meanwhile does not fail: the counts are
- /// the statements sent.
- pub async fn apply_changes(&self, req: &ApplyRequest) -> AppResult {
- let (statements, mut result) = plan_changes(&req.target, &req.changes)?;
- let started = Instant::now();
- let sql = match statements.len() {
- 0 => return Ok(result),
- 1 => statements[0].clone(),
- _ => format!("BEGIN BATCH\n{};\nAPPLY BATCH", statements.join(";\n")),
- };
- self.execute(&ExecRequest { sql, max_rows: 0 }).await?;
- result.elapsed_ms = started.elapsed().as_millis() as u64;
- Ok(result)
- }
-
- // -----------------------------------------------------------------------
- // DDL
-
- pub async fn object_ddl(&self, schema: &str, name: &str, kind: &str) -> AppResult {
- match kind {
- "keyspace" => self.keyspace_ddl(name).await,
- "table" => self.table_ddl(schema, name).await,
- "matview" => self.view_ddl(schema, name).await,
- "type" => self.type_ddl(schema, name).await,
- "function" => self.function_ddl(schema, name).await,
- "aggregate" => self.aggregate_ddl(schema, name).await,
- "index" => self.index_ddl(schema, name).await,
- other => Err(AppError::invalid(format!(
- "LowQuery cannot script a {other} on Cassandra."
- ))),
- }
- }
-
- async fn keyspace_ddl(&self, name: &str) -> AppResult {
- let f = fetch(
- &self.cql,
- &format!(
- "SELECT * FROM system_schema.keyspaces WHERE keyspace_name = {}",
- lit(name)
- ),
- )
- .await?;
- let Some(row) = f.rows.first() else {
- return Ok(String::new());
- };
- let replication = f
- .get(row, "replication")
- .map_or_else(|| "{}".to_string(), literal);
- let durable = f
- .get(row, "durable_writes")
- .map_or_else(|| "true".to_string(), literal);
- Ok(format!(
- "CREATE KEYSPACE {} WITH replication = {replication}\n AND durable_writes = {durable};\n",
- quote_name(name)
- ))
- }
-
- async fn type_ddl(&self, keyspace: &str, name: &str) -> AppResult {
- let f = fetch(
- &self.cql,
- &format!(
- "SELECT * FROM system_schema.types WHERE keyspace_name = {} AND type_name = {}",
- lit(keyspace),
- lit(name)
- ),
- )
- .await?;
- let Some(row) = f.rows.first() else {
- return Ok(String::new());
- };
- let names = text_list(f.get(row, "field_names"));
- let types = text_list(f.get(row, "field_types"));
- let fields: Vec = names
- .iter()
- .zip(&types)
- .map(|(n, t)| format!(" {} {t}", quote_name(n)))
- .collect();
- Ok(format!(
- "CREATE TYPE {}.{} (\n{}\n);\n",
- quote_name(keyspace),
- quote_name(name),
- fields.join(",\n")
- ))
- }
-
- async fn table_ddl(&self, keyspace: &str, name: &str) -> AppResult {
- let f = fetch(
- &self.cql,
- &format!(
- "SELECT * FROM system_schema.tables WHERE keyspace_name = {} AND table_name = {}",
- lit(keyspace),
- lit(name)
- ),
- )
- .await?;
- let Some(row) = f.rows.first() else {
- return Ok(String::new());
- };
- let mut out = String::new();
- let columns = self.catalog_columns(keyspace, name).await?;
- write_create(
- &mut out,
- &format!("CREATE TABLE {}.{}", quote_name(keyspace), quote_name(name)),
- &columns,
- &table_options(&f, row, self.legacy()),
- );
- out.push('\n');
- for statement in self.index_statements(keyspace, Some(name), None).await? {
- out.push_str(&statement);
- out.push('\n');
- }
- Ok(out)
- }
-
- async fn view_ddl(&self, keyspace: &str, name: &str) -> AppResult {
- let f = fetch(
- &self.cql,
- &format!(
- "SELECT * FROM system_schema.views WHERE keyspace_name = {} AND view_name = {}",
- lit(keyspace),
- lit(name)
- ),
- )
- .await?;
- let Some(row) = f.rows.first() else {
- return Ok(String::new());
- };
- let columns = self.catalog_columns(keyspace, name).await?;
- let base = f.text(row, "base_table_name").unwrap_or_default();
- let all = matches!(
- f.get(row, "include_all_columns"),
- Some(CqlValue::Boolean(true))
- );
- let select = if all {
- "*".to_string()
- } else {
- columns
- .iter()
- .map(|c| quote_name(&c.name))
- .collect::>()
- .join(", ")
- };
- let header = format!(
- "CREATE MATERIALIZED VIEW {}.{} AS\n SELECT {select}\n FROM {}.{}\n WHERE {}",
- quote_name(keyspace),
- quote_name(name),
- quote_name(keyspace),
- quote_name(&base),
- f.text(row, "where_clause").unwrap_or_default()
- );
- let mut out = String::new();
- write_primary_key(
- &mut out,
- &header,
- &columns,
- &table_options(&f, row, self.legacy()),
- );
- Ok(out)
- }
-
- async fn catalog_columns(&self, keyspace: &str, table: &str) -> AppResult> {
- let f = fetch(
- &self.cql,
- &format!(
- "SELECT column_name, type, kind, position, clustering_order \
- FROM system_schema.columns WHERE keyspace_name = {} AND table_name = {}",
- lit(keyspace),
- lit(table)
- ),
- )
- .await?;
- let mut cols: Vec = f
- .rows
- .iter()
- .filter_map(|r| {
- Some(CatalogColumn {
- name: f.text(r, "column_name")?,
- type_name: f.text(r, "type")?,
- kind: f.text(r, "kind").unwrap_or_default().to_ascii_lowercase(),
- position: match f.get(r, "position") {
- Some(CqlValue::Int(p)) => *p,
- _ => 0,
- },
- descending: f
- .text(r, "clustering_order")
- .is_some_and(|o| o.eq_ignore_ascii_case("desc")),
- })
- })
- .collect();
- cols.sort_by(|a, b| (a.rank(), a.position, &a.name).cmp(&(b.rank(), b.position, &b.name)));
- Ok(cols)
- }
-
- /// CREATE INDEX statements of a table (or the one index named `only`).
- async fn index_statements(
- &self,
- keyspace: &str,
- table: Option<&str>,
- only: Option<&str>,
- ) -> AppResult> {
- let f = fetch(
- &self.cql,
- &format!(
- "SELECT * FROM system_schema.indexes WHERE keyspace_name = {}",
- lit(keyspace)
- ),
- )
- .await?;
- let mut out = Vec::new();
- for row in &f.rows {
- let (Some(index), Some(on)) = (f.text(row, "index_name"), f.text(row, "table_name"))
- else {
- continue;
- };
- if table.is_some_and(|t| t != on) || only.is_some_and(|o| o != index) {
- continue;
- }
- let kind = f.text(row, "kind").unwrap_or_default();
- let mut options: Vec<(String, String)> = match f.get(row, "options") {
- Some(CqlValue::Map(m)) => m
- .iter()
- .filter_map(|(k, v)| {
- Some((text_of(&Some(k.clone()))?, text_of(&Some(v.clone()))?))
- })
- .collect(),
- _ => Vec::new(),
- };
- let target = options
- .iter()
- .position(|(k, _)| k == "target")
- .map(|i| options.remove(i).1)
- .unwrap_or_default();
- let class = options
- .iter()
- .position(|(k, _)| k == "class_name")
- .map(|i| options.remove(i).1);
- let mut statement = format!(
- "CREATE {}INDEX {} ON {}.{} ({target})",
- if kind == "CUSTOM" { "CUSTOM " } else { "" },
- quote_name(&index),
- quote_name(keyspace),
- quote_name(&on)
- );
- if let Some(class) = class {
- let _ = write!(statement, " USING {}", quote_str(&class));
- if !options.is_empty() {
- options.sort();
- let pairs: Vec = options
- .iter()
- .map(|(k, v)| format!("{}: {}", quote_str(k), quote_str(v)))
- .collect();
- let _ = write!(statement, " WITH OPTIONS = {{{}}}", pairs.join(", "));
- }
- }
- statement.push(';');
- out.push(statement);
- }
- Ok(out)
- }
-
- async fn index_ddl(&self, keyspace: &str, name: &str) -> AppResult {
- Ok(self
- .index_statements(keyspace, None, Some(name))
- .await?
- .join("\n"))
- }
-
- /// Functions and aggregates are named `name(argument types)` in the tree.
- async fn routine_row(
- &self,
- table: &str,
- column: &str,
- keyspace: &str,
- name: &str,
- ) -> AppResult