Tabularis Decoupling RFC #306
Replies: 1 comment
-
|
Thanks for writing this up @NewtTheWolf — it's a good map of the tension, and the symptoms you list are real (the keyword-list drift in #295 and the pagination branches in #286 are exactly the kind of thing that makes me wince every time I open those files). Before I dig in: none of what follows is a decision. It's my read as a maintainer, and it's one input into the discussion — not a verdict. I'd rather we converge on these in the open than have me close them, so push back freely where you see it differently. (Note: the One framing correction before the specifics, because I think it changes how big this looks: the capability contract (14) isn't greenfield. We already have The cleanest proof it works is happening right now: the SQL Server driver on On priorities I'm basically with you:
On the open questions — again, these are positions to argue with, not calls I'm making: 1. Where's the core/driver line for parsing/autocomplete? 2. How does a plugin expose dialect info to the autocomplete hot path without IPC? 3. Bundled vs wizard-installed drivers. One thing I'd explicitly want layered on top: separation of code and enablement are different axes. I'd like a first-run "which databases do you use?" picker that enables the bundled natives (instant toggle, still fully offline) and offers to install third-party ones from the registry (the download path). It declutters the connection modal and gives the registry a natural home. The one line I'd hold firm: enabling a bundled driver must never need a network round-trip — only third-party installs do. Bonus: dogfooding the contract on the drivers we use most — across three different client crates — is the best forcing function for keeping it honest. 4. Plugin API versioning. 5. Backwards compatibility.
That's my two cents, not the final word — if the direction broadly lands I'm happy to turn 1) and 6) into concrete issues so we have something specific to chew on, but I'd like to hear where people disagree first. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Tabularis Decoupling RFC
Note
Category: Idea / RFC. A survey of what we could decouple, how, and why — plus what's probably not worth it. This is a starting point to spark discussion, not a finished plan. Pushback and alternatives very welcome.
Why decouple at all
The core keeps absorbing knowledge that really belongs to a specific driver, feature, or transport. Symptoms we hit recently:
SQL_RESERVED,SQL_KEYWORDS,sqlSplitter/classify.ts) that already drift (fix(autocomplete): suggest clause keywords and correct columns after … #295), and per-dialect pagination branches threaded through core (PaginationDialect::{MySql,Postgres,Sqlite}, MySQLLIMIT off,cnt,FETCH FIRST…) in Derive pagination LIMIT/OFFSET from a SQL parser #286.src-tauri/src/commands.rsis ~152 KB in one file — a coupling magnet every feature has to touch.ai*.rs, tunnels, export/dump) are wired straight into the core even though not every user needs them.Important
Goal: a thin, dialect-agnostic core with clear seams — so adding a driver, transport, or feature is a self-contained change instead of edits sprinkled across shared files.
How to think about it (principles)
Important
Find the seam first. Most of this is "define a capability contract" before moving code. Decoupling without a clean interface just relocates the mess.
The list
Group 1 — Driver / dialect knowledge → a driver capability contract
Note
The foundational seam. Define "what every driver must provide", then move core's dialect special-cases behind it.
build_paginated_queryspecial-cases each dialect in core (#286)paginate(query, page, size)(or a dialect descriptor); core just calls it", MySQL "database == schema" vs PG schemas leak into core (the multiDb mess in #295)information_schemavs native catalog hardcoded per pathdrivers/common/{blob,safe_int}.rsmix generic + dialect bitsGroup 2 — Backend monolith decomposition
Note
Mostly module boundaries + feature gates here, not plugins.
commands.rs(~152 KB)ai*.rs, ~80 KB)ssh_tunnel.rs,k8s_tunnel.rs)TunnelProviderinterface; SSH/k8s become implementations; new transports plug inpool_manager.rs)Group 3 — Frontend
Editor.tsx, autocomplete,sqlAnalysis.ts)modals/~592 KB,ui/~420 KB)Group 4 — The enabling seam
plugin-apialready has hooks/slots/host — extend to driver-level capabilitiesWhat makes sense first
Tip
Suggested order — small, high-signal steps before the big restructuring.
commands.rs— independent, pure maintainability win, can run in parallel.What's probably not worth decoupling
Caution
Decoupling has a cost. These are where it likely isn't worth it — flagging them so the RFC doesn't slide into over-engineering.
Open questions
Warning
Unresolved — these need answers before any of the above becomes a concrete proposal.
Starting point. If the direction lands, each row above can become its own small, concrete proposal.
Beta Was this translation helpful? Give feedback.
All reactions