diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..795614c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,74 @@ +name: Release + +# Builds Gridline installers for macOS (Apple Silicon + Intel), Windows, and +# Linux, then uploads them to a draft GitHub Release. +# +# Trigger: push a version tag from the `main` branch (production), e.g. +# git checkout main && git pull +# git tag v0.5.0 && git push origin v0.5.0 +# +# SIGNING STATUS: builds are UNSIGNED for now (no code-signing certs yet — +# see README "Download a release"). tauri-action automatically signs + +# notarizes when the signing secrets are present, so the moment we add +# APPLE_CERTIFICATE / APPLE_API_KEY / WINDOWS_CERTIFICATE (or Azure Trusted +# Signing) to repo secrets, future builds are signed — no changes to this +# file required. + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + publish: + strategy: + fail-fast: false + matrix: + include: + - platform: macos-latest # Apple Silicon (M1/M2/M3+) + args: --target aarch64-apple-darwin + - platform: macos-15-intel # Intel Macs (last Intel runner; retired ~Aug 2027) + args: --target x86_64-apple-darwin + - platform: ubuntu-22.04 # Linux x86_64 (.deb / .rpm / .AppImage) + args: '' + - platform: windows-latest # Windows x86_64 (NSIS .exe + .msi) + args: '' + runs-on: ${{ matrix.platform }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Linux dependencies + if: matrix.platform == 'ubuntu-22.04' + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + + - name: Set up Bun + uses: oven-sh/setup-bun@v2 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-apple-darwin, x86_64-apple-darwin + + - name: Cache Rust build artifacts + uses: swatinem/rust-cache@v2 + with: + workspaces: './src-tauri -> target' + + - name: Install frontend dependencies + run: bun install --frozen-lockfile + + - name: Build and upload to GitHub Release + uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tagName: ${{ github.ref_name }} + releaseName: 'Gridline ${{ github.ref_name }}' + releaseDraft: true + args: ${{ matrix.args }} \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index 37087b5..0cf0ade 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -284,11 +284,11 @@ cargo test # Rust tests ### Backup & Restore | Feature | Status | Details | | :--- | :---: | :--- | -| pg_dump wrapper | ✅ | Rust command spawns pg_dump with real-time progress events (backup-progress) | -| pg_restore wrapper | ✅ | Rust command spawns pg_restore with progress events | +| pg_dump wrapper | ✅ | Rust command spawns pg_dump with real-time progress events (backup-progress). Core logic extracted into headless-testable `run_pg_dump` (takes `PgConnParams` + options directly); Tauri command is a thin wrapper (store lookup → keychain → run → emit). Live integration tests in `backup.test.rs` (`#[ignore]`d, driven by `GRIDLINE_TEST_SRC_*`/`GRIDLINE_TEST_TGT_*` env vars) | +| pg_restore wrapper | ✅ | Rust command spawns pg_restore with progress events. **Plain-format dumps are executed via `psql -f`** (pg_restore can't read plain SQL text); custom/tar/directory use pg_restore. Core logic in headless-testable `run_pg_restore` | | Backup UI | ✅ | In-page view: format selector, file browse (Tauri dialog), schema dropdown, no-owner toggle, progress bar with event-driven status | -| Restore UI | ✅ | In-page view: file browse, format, clean toggle, destructive confirmation checkbox, progress bar | -| DB-to-DB sync | ✅ | In-page view: source/target connection pickers, schema dropdown, pipe-based pg_dump → pg_restore | +| Restore UI | ✅ | In-page view: file browse, format, clean toggle, destructive confirmation checkbox, progress bar. **Clean toggle is disabled for plain format** (psql can't DROP-before-CREATE) with a hint to use Custom Archive | +| DB-to-DB sync | ✅ | In-page view: source/target connection pickers, schema dropdown, pipe-based pg_dump → pg_restore. **pg_restore side passes `--clean --if-exists`**, so sync works into a non-empty target (UI already requires destructive-overwrite confirmation). Core logic in headless-testable `run_db_sync` | | Unified Tools view | ✅ | Backup / Restore / DB Sync merged into a single **Tools** nav item; operation-switcher dropdown in the view toolbar, existing forms rendered below | | SQLite .dump | ❌ | | | Table structure export (DDL) | ❌ | | diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..85b7b83 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to the Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index 87db65b..6ff5ea0 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,117 @@ -# Gridline +
+
+
+ A lightweight, open-source database GUI for PostgreSQL and SQLite.
+ Unlimited connections, tabs, and saved queries — with first-class pg_dump, pg_restore, and DB-to-DB sync.
+
+ Data Grid & FK Preview — browse 50+ real demo orders and inspect related rows in one click. +
+ + + + --- -## Why Gridline? +## What is Gridline? -Most database GUI clients either lock essential productivity features behind paywalls or treat PostgreSQL administration as an afterthought. Gridline is different: +Gridline is a modern, open-source database GUI client built with [Tauri 2.0](https://tauri.app), Rust, and React. It is lightweight by design (~40 MB baseline), powerful by default, and free from the paywalls that limit commercial alternatives. -| Capability | DB Pro (Free) | Beekeeper (Free) | Gridline | -| :--- | :---: | :---: | :---: | -| Open tabs | 3 | Unlimited | **Unlimited** | -| Saved connections | 2 | Unlimited | **Unlimited** | -| Saved queries | 5 | Unlimited | **Unlimited** | -| Data export (CSV, JSON, SQL) | ❌ (paid only) | Basic only | **JSON, CSV, SQL, Markdown** | -| Data import (CSV, JSON) | ❌ (paid only) | ✅ | **✅ CSV/JSON + column mapping** | -| pg_dump / pg_restore GUI | ❌ | ❌ (paid only) | **First-class UI** | -| DB-to-DB sync | ❌ | ❌ | **Built-in pipe sync** | -| Object explorer depth | Tables, views | Tables, views | **Functions, Triggers, Enums, Sequences, Extensions** | -| Indexes, constraints, matviews, procedures | 🔒 paid | ❌ | **✅ Full object views** | -| ER diagram / schema visualizer | ❌ (planned) | ❌ (paid only) | **✅ Interactive React Flow** | -| Inline cell editing | ✅ | ✅ | **✅ Inline editing** (double-click / Enter, ctid/rowid locator, stale-write guard; optimistic staged values + pending dot from the changes queue; smart editors — PG enum dropdowns and searchable FK dropdowns of referenced rows) | -| Keyboard cell navigation | ✅ | ✅ | **✅** (arrows + Tab wrap, Esc cancels editing) | -| Cell copy (right-click / Ctrl+C) | ✅ | ✅ | **✅** (context menu: Copy / Copy JSON / Edit / Set NULL / Open FK / View Row / Select Row) | -| Row detail drawer | ✅ | ✅ | **✅** (via context menu View Row) | -| Visual filter builder | ✅ | ✅ | **✅** (drag-and-drop, type-aware operators) | -| SSH tunneling | 🟡 (likely paid) | ✅ | **✅ Full tunnel (password + key auth, keychain)** | -| OS credential vault | ✅ | ✅ | **Keychain / Secret Service** | -| Workspace / folder hierarchy | ❌ | ❌ | **Multi-level tree + tags** | -| Favorites / Recent connections | ✅ | ✅ | **✅ Star + recents row** | -| Connection status indicator | ❌ | ✅ | **✅ On-demand click-to-test dot** | -| Bulk move-to-folder | ✅ | ✅ | **✅ Selection toolbar → folder picker** | -| Changes queue (stage & commit) | ❌ | ❌ | **✅ Queue → Commit All** (tab-bar **Changes** button with count badge toggles a popover: Visual/SQL preview, per-change revert, Clear All, ⌘S commit) | -| Query history | ✅ (auto-saved) | ✅ | **✅ Toolbar dropdown, favorites, Queries view** | -| AI assistant | ✅ (BYO key) | ❌ (paid only) | 🔮 *Planned — BYOK* | -| Open source | ❌ | ✅ (GPLv3) | **✅ (MIT)** | -| Desktop shell | Native webview | Electron (~250MB) | **Tauri 2.0 (~40MB)** | +- **No caps** on connections, tabs, or saved queries. +- **Deep PostgreSQL tooling** — visual `pg_dump`, `pg_restore`, and DB-to-DB sync. +- **Full object explorer** — not just tables, but functions, triggers, sequences, enums, extensions, materialized views, and procedures. +- **Interactive ER diagram** — explore relationships visually with crow's-foot cardinality notation. +- **Production-safe editing** — stage INSERT/UPDATE/DELETE changes, review the generated SQL, then commit all at once. -> 🟡 = In progress or planned. **Bold** = Gridline's strongest differentiators. +The app ships with a built-in **Gridline Demo (SQLite)** database, so you can explore every feature immediately without setting up a server. + +--- + +## Who is it for? + +Gridline is built for developers and small teams who manage multiple database environments: + +- **Full-stack developers** switching between local, staging, and production databases. +- **Platform / DBAs** who need `pg_dump`, `pg_restore`, and sync tooling in a native UI. +- **Teams that want native speed** without Electron bloat or seat licenses. + +--- + +## Recent Changes + +- **2026-08-04:** Revamped the built-in SQLite demo database with realistic e-commerce data (20 users, 24 products, 50 orders, 100 page views, 500 audit rows) and renamed it to **Gridline Demo (SQLite)**. +- **2026-07-XX:** Added inline cell editing with a stage-first changes queue, row-detail drawer, keyboard navigation, and cell-level copy. +- **2026-07-XX:** Added visual filter builder with drag-and-drop column palette and type-aware operators. +- **2026-07-XX:** Added schema visualizer with React Flow + dagre, crow's-foot notation, and cross-schema FK support. +- **2026-07-XX:** Added query history dropdown, saved queries, and a two-pane Queries view. +- **2026-06-XX:** Added settings redesign with live theme, accent color, font size, editor options, and tag reorder. +- **2026-06-XX:** Added SSH tunneling (password + key auth) and full PostgreSQL TLS runtime for production connections. + +> See the full history in the [roadmap](#roadmap) below or the [git log](./commits). + +--- + +## Key Features + +### Connections & Workspace + +- **URI auto-fill** — paste `postgres://`, `mysql://`, `sqlite://`, or `redis://` strings and have all fields populate automatically. +- **Workspace tree** — multi-level folders, color-coded tags, favorites, and recent connections. +- **OS keychain storage** — passwords and SSH secrets live in macOS Keychain / Linux Secret Service / Windows Credential Manager, never in plaintext. +- **SSH tunneling** — real `ssh2` tunnels with password or key authentication. +- **TLS / SSL** — full PostgreSQL/MySQL TLS modes plus client-certificate support. +- **Connection status** — on-demand per-card test with real server version and latency. + +### Schema Explorer + +- **Tables, views, and materialized views** — column metadata, PK/FK, defaults, nullable flags. +- **Functions & procedures** — syntax-highlighted source, argument signatures, overload disambiguation. +- **Triggers, sequences, enums, extensions** — unified **Objects** view with type switcher. +- **Indexes & constraints** — per-table index details plus CHECK/UNIQUE constraints beyond PK/FK. +- **Schema visualizer** — interactive ER diagram with auto-layout, cardinality legend, and collapsible columns. + +### Data Grid + +- **Virtualized rows** — handles 100k+ rows via `@tanstack/react-virtual`. +- **Server-side filtering & sorting** — pushed to SQL `WHERE`/`ORDER BY`. +- **FK preview** — click the ↗ icon on a foreign-key cell to inspect the referenced row or open a filtered tab. +- **JSON/JSONB viewer** — formatted and raw tabs with copy. +- **Inline cell editing** — double-click or press Enter; changes stage through the queue before commit. +- **Smart editors** — enum dropdowns for PG enum columns, searchable FK dropdowns for related rows. +- **Visual filter builder** — drag-and-drop columns with type-aware operators. +- **Export** — JSON, CSV, SQL, and Markdown downloads of visible rows. +- **Auto-refresh** — configurable interval timer. + +### Query Workbench + +- **Monaco SQL editor** — lazy-loaded, with keywords + table/column autocomplete. +- **Custom query execution** — arbitrary SQL with destructive-query confirmation. +- **Query tabs** — unlimited tabs, close with `Cmd/Ctrl+W`. +- **Query history** — per-connection, with favorites and pruning. +- **Saved queries** — name, folder, and manage them in the Queries view. +- **Changes queue** — stage edits, review generated SQL, revert per change, then commit all. + +### PostgreSQL Admin Tools + +- **Visual Backup** — `pg_dump` wrapper with format selector, schema filter, no-owner toggle, real-time progress. +- **Visual Restore** — `pg_restore` wrapper with clean toggle and destructive confirmation. +- **DB-to-DB Sync** — pipe `pg_dump` → `pg_restore` between two connections. --- @@ -50,34 +122,34 @@ Most database GUI clients either lock essential productivity features behind pay
-
-
+
+
- Home Screen — organized folders, tags, and quick search + Query Editor |
-
-
+
+
- Data Grid — virtualized rows, column controls, and FK preview + Schema Visualizer |
-
-
+
+
- Schema Visualizer — interactive ER diagram with cardinality legend + JSON Viewer |
-
-
+
+
- Object Explorer — deep PostgreSQL objects like enums, functions, and triggers + Home Screen |
- Built with ♥ for developers who believe powerful tools should be free. -
\ No newline at end of file +Apache 2.0 — see [LICENSE](./LICENSE) for details. diff --git a/package.json b/package.json index 9389d99..2312a4b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gridline", "private": true, - "version": "0.5.0", + "version": "0.6.0", "description": "An open-source, high-performance database GUI client for PostgreSQL and beyond", "type": "module", "scripts": { diff --git a/screenshots/data-grid.png b/screenshots/data-grid.png index 5208ba1..60a7ae3 100644 Binary files a/screenshots/data-grid.png and b/screenshots/data-grid.png differ diff --git a/screenshots/enums.png b/screenshots/enums.png deleted file mode 100644 index b5eb436..0000000 Binary files a/screenshots/enums.png and /dev/null differ diff --git a/screenshots/er-diagram.png b/screenshots/er-diagram.png index b0e7224..33881ca 100644 Binary files a/screenshots/er-diagram.png and b/screenshots/er-diagram.png differ diff --git a/screenshots/home.png b/screenshots/home.png index b4a986a..a96f749 100644 Binary files a/screenshots/home.png and b/screenshots/home.png differ diff --git a/screenshots/json-popover.png b/screenshots/json-popover.png new file mode 100644 index 0000000..f7c8a14 Binary files /dev/null and b/screenshots/json-popover.png differ diff --git a/screenshots/query-editor.png b/screenshots/query-editor.png new file mode 100644 index 0000000..ce246f9 Binary files /dev/null and b/screenshots/query-editor.png differ diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 565a710..18305d1 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1783,7 +1783,7 @@ dependencies = [ [[package]] name = "gridline" -version = "0.5.0" +version = "0.6.0" dependencies = [ "chrono", "deadpool-postgres", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index bdd9fd5..69a87b8 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gridline" -version = "0.5.0" +version = "0.6.0" description = "An open-source, high-performance database GUI client for PostgreSQL and beyond" authors = ["you"] edition = "2021" diff --git a/src-tauri/src/commands/backup.rs b/src-tauri/src/commands/backup.rs index 2e0bac6..80f96d3 100644 --- a/src-tauri/src/commands/backup.rs +++ b/src-tauri/src/commands/backup.rs @@ -3,6 +3,37 @@ use tauri::{AppHandle, Emitter, State}; use crate::models::backup::*; +// --------------------------------------------------------------------------- +// Connection params (decoupled from store/keychain so logic is headless-testable) +// --------------------------------------------------------------------------- + +#[derive(Debug, Clone)] +pub struct PgConnParams { + pub host: String, + pub port: i64, + pub username: String, + pub database: String, + pub password: String, +} + +impl PgConnParams { + pub fn new( + host: String, + port: i64, + username: String, + database: String, + password: String, + ) -> Self { + Self { + host, + port, + username, + database, + password, + } + } +} + // --------------------------------------------------------------------------- // Helpers // --------------------------------------------------------------------------- @@ -16,6 +47,10 @@ fn get_version(tool: &str) -> Option|
-
+
+ |
-
{col.is_pk &&
+ |
{isNull ? (
NULL
) : (
diff --git a/src/components/db-viewer/RestorePage.tsx b/src/components/db-viewer/RestorePage.tsx
index cdd9e08..4c434f4 100644
--- a/src/components/db-viewer/RestorePage.tsx
+++ b/src/components/db-viewer/RestorePage.tsx
@@ -239,14 +239,21 @@ export function RestorePage({ connectionId }: RestorePageProps) {
{/* Clean toggle */}
- | |