Skip to content

feat: Go + Wails backend, phase 1 (SQLite, PostgreSQL) - #42

Merged
FabioHAraujo merged 1 commit into
mainfrom
feat/go-wails-rewrite
Dec 4, 2026
Merged

FabioHAraujo merged 1 commit into
mainfrom
feat/go-wails-rewrite

Conversation

@FabioHAraujo

Copy link
Copy Markdown
Contributor

Phase 1 of the Go + Wails rewrite. The backend moves from Rust/Tauri to Go on Wails v3; the Svelte interface stays. src-tauri is untouched and stays until the Go build reaches parity, so this PR stays a draft through the next phases.

What's in

  • App shell (main.go): frameless Wails window, dist/ embedded, version from package.json. The window starts hidden and is shown once the page paints, as today.
  • Command bridge (internal/app): one bound method, Service.Invoke(command, args), answers the Tauri command names and named arguments, so api.ts and the dev mock stay as they are. Errors keep the same {kind, message, code, position, detail, hint} shape.
  • Profiles and passwords (internal/profiles): same connections.json folder, and same credential store entries (Windows Credential Manager target <id>.dev.lowbloat.lowquery, UTF-16 blob), so existing profiles and saved passwords keep working.
  • SQLite (ncruces/go-sqlite3, no cgo) and PostgreSQL (pgx/pgconn, binary values decoded as in pg_value.rs), both checked against the shared view.fixtures.json and ddl.fixtures.json.
  • Interface host layer (src/lib/host.ts) replaces every @tauri-apps import: dialogs, window frame, events, opener, exit.
  • CI: a go job (gofmt, vet, tests against PostgreSQL 13 and 17) and a go-app job that builds the Windows executable.

Commands not ported yet (other engines, export/import, importers, MCP, AI setup) answer "not available in this build". Update checks only notify and open the releases page; the macOS native menu is stubbed.

Build times (Windows dev machine)

Rust/Tauri Go/Wails
Cold build 3m37s 18.8s
Incremental, after editing a driver several minutes ~1s

Testing

  • go test ./internal/...: SQLite (29 tests) and PostgreSQL (32 tests against a PostgreSQL 18 server; skipped without LQ_PG_*).
  • svelte-check: 0 errors, 0 warnings.
  • Driven the dev app over CDP: SQLite and PostgreSQL sessions, results and value kinds, row limit, grid edits, DDL, error positions, manual transactions, password prompt, query cancel, window maximize/restore.
  • Production executable (bun run build:app, 19.3 MB) starts and renders from embedded assets.

Next phases

  1. Oracle, MySQL/MariaDB, SQL Server, Redis, Cassandra.
  2. Importers, export/import, MCP server, AI setup.
  3. Installers, release CI, auto-update from the Tauri build, macOS menu, local storage drafts migration (the page origin changes), remove src-tauri.

Closes #41

Start replacing the Rust/Tauri backend with Go on Wails v3, keeping the
Svelte interface. src-tauri stays until the Go build reaches parity.

- main.go: Wails app with a frameless window, embedded dist/ and the
  version from package.json.
- internal/app: one bound method, Service.Invoke, answers the same
  command names and arguments as the Tauri commands, so api.ts and the
  dev mock are unchanged.
- internal/profiles: reads and writes connections.json in the same
  folder, and saved passwords in the same credential store entries.
- internal/drivers: SQLite (ncruces/go-sqlite3) and PostgreSQL (pgx,
  binary values decoded as in pg_value.rs), checked against the shared
  view and DDL fixtures.
- src/lib/host.ts replaces the @tauri-apps imports: dialogs, window
  frame, events, opener.
- Update checks only notify for now; the macOS menu is stubbed.
- CI: Go tests against PostgreSQL 13 and 17, and a Windows app build.

Refs #41
@FabioHAraujo
FabioHAraujo marked this pull request as ready for review December 4, 2026 23:51
@FabioHAraujo
FabioHAraujo merged commit 7e533d7 into main Dec 4, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite the backend in Go + Wails (phase 1: skeleton, SQLite, PostgreSQL)

1 participant