{"id":50102093,"url":"https://github.com/rmnunes/pg-shell","last_synced_at":"2026-05-23T08:03:02.201Z","repository":{"id":354383053,"uuid":"1223369118","full_name":"rmnunes/pg-shell","owner":"rmnunes","description":"Lightweight desktop Postgres client — Rust + Tauri v2 + Monaco. Aiming for Azure Data Studio weight with Redgate SQL Prompt-class intellisense.","archived":false,"fork":false,"pushed_at":"2026-05-22T15:00:33.000Z","size":468,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-22T20:11:37.751Z","etag":null,"topics":["database-tool","desktop-app","intellisense","monaco-editor","postgres","postgresql","rust","sql-editor","ssms-alternative","tauri"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmnunes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-28T08:58:39.000Z","updated_at":"2026-05-22T15:00:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rmnunes/pg-shell","commit_stats":null,"previous_names":["rmnunes/pg-shell"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rmnunes/pg-shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmnunes%2Fpg-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmnunes%2Fpg-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmnunes%2Fpg-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmnunes%2Fpg-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmnunes","download_url":"https://codeload.github.com/rmnunes/pg-shell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmnunes%2Fpg-shell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33387657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-tool","desktop-app","intellisense","monaco-editor","postgres","postgresql","rust","sql-editor","ssms-alternative","tauri"],"created_at":"2026-05-23T08:03:01.104Z","updated_at":"2026-05-23T08:03:02.192Z","avatar_url":"https://github.com/rmnunes.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pg-shell\n\nA lightweight desktop Postgres query tool aiming for the feel of Azure Data Studio with the intellisense quality of Redgate SQL Prompt in SSMS.\n\n\u003e **Status — early WIP.** The architecture is locked in and a vertical slice is coming together. v1 honestly targets ~70% Redgate parity; see [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the full plan and honest scope notes.\n\n## Why\n\nExisting Postgres clients miss the spot Rodrigo (and probably you) actually want:\n\n- **pgAdmin / DBeaver** — feature-rich but heavy and the editor isn't great.\n- **Beekeeper / Tabularis** — light, but completion is shallow.\n- **Azure Data Studio** — perfect weight, but Microsoft retired it and Postgres support was always a side feature.\n- **pgMagic / Datagrip** — closer to Redgate-class, but commercial, big install, and not Postgres-first.\n\n`pg-shell` is the tool we want: ADS-class lightness, Postgres-native, with a completion engine that knows your aliases, ranks by what you actually use, and ships snippets like `ssf` → `SELECT * FROM `.\n\n## Stack\n\n- **Backend:** Rust — `tauri` v2, `sqlx`, `pg_query` (libpg_query), `keyring`, `dashmap`.\n- **Frontend:** Vite + React 19 + Monaco Editor + TanStack Virtual + Zustand.\n- **Shell:** System WebView (WebView2 on Windows). No Electron, no bundled Chromium.\n\nThe Cargo workspace is split so the intellisense engine can be reused or tested in isolation:\n\n```\npg-shell/\n├── Cargo.toml              workspace root\n├── package.json            Vite + React + Monaco frontend\n├── src-tauri/              Tauri binary crate + IPC commands\n├── crates/\n│   ├── pg-core             sqlx pool manager, query exec, streaming, cancel\n│   ├── pg-intellisense     tokenizer + partial-parse + context + ranker + snippets\n│   ├── pg-schema-cache     pg_catalog introspection + DashMap + bincode snapshots\n│   └── pg-profiles         connection profiles + OS keychain\n└── src/                    React UI: editor, results grid, object tree\n```\n\n## Prerequisites\n\n### Windows (primary target)\n\n- **Rust stable** with the MSVC toolchain (`rustup install stable`)\n- **Visual Studio Build Tools 2022** with the \"Desktop development with C++\" workload — needed by `cc` for the `pg_query` C build\n- **Node 20+** and **pnpm 9+** (`corepack enable` is the easiest path)\n- **WebView2** runtime (preinstalled on Windows 11)\n\n### macOS / Linux\n\n- Rust stable + standard C toolchain (`build-essential` / Xcode CLT)\n- `webkit2gtk-4.1` on Linux (see [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/))\n- Node 20+ and pnpm 9+\n\n### Optional: `libpg_query`-enhanced intellisense\n\nThe intellisense engine ships with a token-based FROM-binding extractor that handles the vast majority of queries. For stricter alias resolution inside LATERAL joins, CTEs, and deeply-nested subqueries, enable the `libpg_query` feature. It uses Postgres's own parser via the `pg_query` crate, which requires LLVM:\n\n```powershell\nwinget install LLVM.LLVM\n# Reopen the shell so LIBCLANG_PATH resolves.\n```\n\n```sh\n# macOS\nbrew install llvm\n# Debian/Ubuntu\nsudo apt install llvm-dev libclang-dev clang\n```\n\nThen in `src-tauri/Cargo.toml` add `features = [\"libpg_query\"]` to the `pg-intellisense` dependency:\n\n```toml\npg-intellisense = { path = \"../crates/pg-intellisense\", features = [\"libpg_query\"] }\n```\n\nThe engine picks the AST automatically when the buffer parses and falls back to the token walker when it doesn't, so this is a pure upgrade — no behavior change for simple queries.\n\n## Develop\n\n```sh\npnpm install\npnpm tauri dev\n```\n\nThe first build takes a while (sqlx + tauri are not small). Subsequent rebuilds are fast.\n\n## Release build\n\n```sh\npnpm tauri build\n```\n\nArtifacts land in `src-tauri/target/release/bundle/`.\n\n## What works today / what's next\n\nSee [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the full sequenced roadmap. Headline items:\n\n- [x] Workspace scaffold, Tauri boots, React shell\n- [x] Connection profiles + OS keychain (passwords never on disk)\n- [x] Test connection on new and saved profiles\n- [x] Query execution with streaming results\n- [x] Query cancellation\n- [x] Schema introspection + object tree (Tree + Flat views)\n- [x] Type-aware grid rendering (NULL, jsonb, bytea, timestamptz, numeric)\n- [x] CSV / TSV / JSON export from the results grid\n- [x] Monaco completion provider wired through Tauri IPC\n- [x] Token-based + libpg_query AST partial-parse pipeline\n- [x] Ranker + MRU persistence (SQLite-backed accept counts)\n- [x] Builtin snippet library (`ssf`, `sf`, `ct`, `j`, `lj`, `cte`, …)\n- [x] Right-click \"Script as SELECT / INSERT\" + \"View Definition\"\n- [x] Function signature help\n- [x] DDL-triggered schema cache refresh (object tree auto-updates after `CREATE`/`ALTER`/`DROP`)\n- [ ] User-defined snippets\n- [ ] Auto-alias on table insert (`FROM users` → `FROM users u`)\n- [ ] Cross-CTE column binding, LATERAL join awareness\n- [ ] Refactor-rename, semantic squigglies\n\n## Contributing\n\nContributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a PR — it covers local setup, the testing strategy (golden-file completion corpus + `testcontainers` for the schema cache), and the coding conventions we hold the line on.\n\nIf you're using Claude Code or another agent to work on the repo, [CLAUDE.md](CLAUDE.md) is the orientation file — it explains the architecture in agent-readable form and points at the right crates for each kind of change.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmnunes%2Fpg-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmnunes%2Fpg-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmnunes%2Fpg-shell/lists"}