{"id":20959405,"url":"https://github.com/rust-dd/rust-sql","last_synced_at":"2026-03-08T21:10:18.292Z","repository":{"id":210600258,"uuid":"726938217","full_name":"rust-dd/rust-sql","owner":"rust-dd","description":"A fully Rust-based application for efficient and secure database management.","archived":false,"fork":false,"pushed_at":"2024-12-09T09:01:22.000Z","size":4184,"stargazers_count":17,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T10:08:12.309Z","etag":null,"topics":["database","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-dd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-03T20:44:36.000Z","updated_at":"2025-05-16T17:58:07.000Z","dependencies_parsed_at":"2024-03-04T00:32:12.008Z","dependency_job_id":"d22e76d0-02f0-4195-9104-70d89d6e9a78","html_url":"https://github.com/rust-dd/rust-sql","commit_stats":null,"previous_names":["dancixx/rust-sql","rust-dd/rust-sql"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/rust-dd/rust-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-dd%2Frust-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-dd%2Frust-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-dd%2Frust-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-dd%2Frust-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-dd","download_url":"https://codeload.github.com/rust-dd/rust-sql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-dd%2Frust-sql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267906880,"owners_count":24164167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","rust"],"created_at":"2024-11-19T01:54:30.884Z","updated_at":"2026-03-08T21:10:18.281Z","avatar_url":"https://github.com/rust-dd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RSQL\n\nA high-performance PostgreSQL client built with Tauri v2, React, and Rust. Designed from the ground up to be fast — even with millions of rows.\n\n![Preview](https://i.ibb.co/S4sPh4TC/rsql.png)\n\n## Important\nApp signing is in progress. To allow on macOS, use the following command:\n\n```bash\nxattr -dr com.apple.quarantine /Applications/RSQL.app\n```\n\n\n## Why It's Fast\n\n### Zero-Copy Wire Protocol\nQueries use PostgreSQL's **simple_query protocol** — the server returns all values as pre-formatted text. No type conversion, no ORM mapping, no intermediate representations. Raw text goes straight from the TCP socket to the frontend.\n\n### Packed Binary IPC\nResults are encoded as flat strings with ASCII unit/record separators (`\\x1F` / `\\x1E`), not nested JSON arrays. This eliminates JSON serialization overhead entirely for result data. A 100K-row result serializes in microseconds, not milliseconds.\n\n### Pre-Allocated String Packing\nRow packing uses a single pre-allocated `String` buffer with capacity estimation. No intermediate `Vec\u003cString\u003e` per row, no `.join()` chains, no `.replace()` allocations. Separator sanitization is done inline, character by character.\n\n### Virtual Pagination with Server-Side Cursors\nLarge results (\u003e2K rows) use PostgreSQL cursors with `FETCH` batching. Pages are pre-packed into cache-friendly strings on the Rust side. Page serving is O(1) — zero packing at read time. Only pages near the viewport are kept in memory; distant pages are evicted automatically.\n\n### Dual Connection Pool\nEach database connection maintains two TCP sockets:\n- **Query connection** — user queries, EXPLAIN, virtual pagination\n- **Metadata connection** — schema loading, table info, activity monitoring\n\nThis means metadata loads never block while a long query runs, and vice versa.\n\n### WebGL Canvas Rendering\nThe results grid renders directly to a WebGL canvas via `@glideapps/glide-data-grid`. No DOM nodes per cell. Scrolling through 500K rows is as smooth as scrolling through 50.\n\nVirtual scroll invalidation uses `requestAnimationFrame` batching — multiple page fetches within one frame cause only one re-render. Theme override objects are pre-computed once, not re-created per cell.\n\n### Parallel Processing\nResults over 50K rows use Rayon for parallel page packing across CPU cores. Below that threshold, sequential processing is faster due to cache locality.\n\n### Debounced Search\nFull-text search across results is debounced at 200ms to avoid filtering 50K+ rows on every keystroke.\n\n### SIMD JSON Serialization\nAll IPC command responses bypass Tauri's default `serde_json` serializer. Instead, results are pre-serialized with `sonic-rs` (SIMD-accelerated) and returned as raw `tauri::ipc::Response` — zero re-serialization by the framework. ~3.5x faster than serde_json for typical payloads.\n\n### Multi-Statement Execution\n`simple_query` handles `SELECT 1; INSERT ...; SELECT * FROM users;` natively. Returns the last result set that had rows — no splitting or reparsing on the client side.\n\n## Features\n\n- **Monaco SQL editor** — syntax highlighting, context-aware autocomplete (schemas, tables, columns, aliases), SQL snippets, formatter\n- **Results grid** — WebGL canvas, column sorting, inline editing (UPDATE/DELETE with transactions), export (CSV, JSON, SQL, Markdown, XML)\n- **Database explorer** — tree sidebar with schemas, tables, views, materialized views, functions, triggers, indexes, constraints, policies\n- **ERD diagrams** — interactive entity-relationship diagrams with FK lines, drag-and-drop, SVG export\n- **FK navigation** — click foreign key values to jump to referenced rows\n- **Map view** — automatic detection of PostGIS geometry/geography columns (WKT, GeoJSON, EWKB), rendered on OpenStreetMap tiles via Leaflet with Point, LineString, and Polygon support\n- **EXPLAIN visualizer** — `EXPLAIN (ANALYZE, FORMAT JSON)` with plan tree rendering\n- **Performance monitor** — live `pg_stat_activity`, database stats, table stats\n- **Diff tool** — pin a result, run another query, see added/removed rows (diff computed in Rust)\n- **Inline terminal** — built-in PTY terminal via `portable-pty` + `xterm.js`\n- **Command palette** — Cmd+K/Cmd+P fuzzy search across all database objects, actions, and saved workspaces\n- **Workspaces** — save and restore tab groups across sessions\n- **Query history** — searchable execution history with timing and row counts\n- **Notifications** — OS-level notifications for long-running queries (\u003e5s) when app is unfocused\n\n## Tech Stack\n\n| Layer | Technology |\n|-------|-----------|\n| Frontend | React 19, TypeScript, Zustand, Monaco Editor, Leaflet |\n| UI | Tailwind CSS v4, shadcn/ui, oklch color system |\n| Results Grid | @glideapps/glide-data-grid (WebGL canvas) |\n| Terminal | xterm.js + portable-pty |\n| Backend | Rust, Tauri v2, tokio-postgres (simple_query protocol) |\n| Performance | sonic-rs (SIMD JSON), rayon (parallel packing), packed binary IPC, dual connection pool |\n\n## Development\n\n```bash\n# Install dependencies\nyarn install\n\n# Run in development mode\nyarn tauri dev\n\n# Build for production\nyarn tauri build\n```\n\n## Release Workflow\n\nThe release workflow (`.github/workflows/release.yml`) builds release artifacts, signs updater metadata, and currently signs Windows and Linux artifacts. macOS signing/notarization is intentionally still pending.\n\nUpdater support is now wired into the app runtime as well. The app checks GitHub Releases via `https://github.com/rust-dd/rust-sql/releases/latest/download/latest.json`, and the packaged build enables a manual \"Check for Updates\" action plus a silent startup check.\n\nRequired updater secrets:\n\n- `TAURI_UPDATER_PUBLIC_KEY` (public key content generated by `yarn tauri signer generate`)\n- `TAURI_SIGNING_PRIVATE_KEY` (path or content of the private updater signing key)\n- Optional: `TAURI_SIGNING_PRIVATE_KEY_PASSWORD`\n\nPlatform code signing / notarization secrets:\n\n- Windows: `WINDOWS_CERTIFICATE` (base64-encoded `.pfx`)\n- Windows: `WINDOWS_CERTIFICATE_PASSWORD`\n- Windows optional: `WINDOWS_TIMESTAMP_URL` (defaults to `http://timestamp.digicert.com`)\n- Linux: `TAURI_SIGNING_RPM_KEY` (ASCII-armored private GPG key)\n- Linux optional: `TAURI_SIGNING_RPM_KEY_PASSPHRASE`\n- Linux/AppImage: `APPIMAGETOOL_SIGN_PASSPHRASE`\n- Linux optional: `SIGN_KEY` (specific GPG key id or fingerprint for AppImage signing)\n- macOS later: `APPLE_CERTIFICATE` (base64-encoded `.p12` Developer ID Application certificate)\n- macOS later: `APPLE_CERTIFICATE_PASSWORD`\n- macOS later: `APPLE_SIGNING_IDENTITY` (for example: `Developer ID Application: Your Name (TEAMID)`)\n- macOS later notarization option A: `APPLE_ID`, `APPLE_PASSWORD` (app-specific password), `APPLE_TEAM_ID`\n- macOS later notarization option B: `APPLE_API_KEY`, `APPLE_API_ISSUER`, `APPLE_API_KEY_P8`\n\nNotes:\n\n- `bundle.createUpdaterArtifacts` is enabled, so release builds will generate signed updater artifacts and `latest.json`.\n- The updater uses the latest published GitHub release. Draft releases are not visible to clients until you publish them.\n- If you build locally without `TAURI_UPDATER_PUBLIC_KEY`, the app still builds, but the updater plugin stays disabled for that build.\n- The current release workflow requires the updater secrets above, plus the Windows and Linux signing secrets listed here. macOS signing secrets are documented for the later notarized rollout.\n\nFor manual runs (`workflow_dispatch`), provide the release tag explicitly, for example `v1.x.x`.\n\nAfter the updater secrets are configured, pushing a tag like `v1.x.x` builds release artifacts and publishes signed updater metadata.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-dd%2Frust-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-dd%2Frust-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-dd%2Frust-sql/lists"}