SQL Server driver — implementation roadmap & call for contributors
Status
Phase 1 is done on feat/sql-server. Clean-room tiberius + deadpool, peer to MySQL / PostgreSQL / SQLite. Not merged to main. Not in any released build. The branch squashes into main when Phase 2 closes via #149.
Phase 2 (editing + TLS + composite keys) is open for contribution. Phase 3 (DDL + EXPLAIN + Azure AD) is on the roadmap.
471 Rust tests pass, zero regressions on the existing drivers.
Contributors: branch off feat/sql-server, not main. Target your PR at feat/sql-server, not main.
Phase 1 — done on feat/sql-server
- Driver registered in
src-tauri/src/lib.rs, selectable from the Connection modal
readonly: true manifest (INSERT / UPDATE / DELETE hidden in UI during the preview)
- Pool built on
deadpool + a custom tiberius::Manager (src-tauri/src/drivers/sqlserver/pool.rs)
- Schema discovery via
sys.* + INFORMATION_SCHEMA.* (tables / columns / FK / indexes / views / routines)
execute_query with dialect-aware pagination (PaginationDialect::OffsetFetch, added to drivers/common/query.rs)
- Type extraction for 20+ SQL Server types (bit, int family, float family, decimal / numeric / money, uniqueidentifier, temporal family, char / varchar / nvarchar / xml, binary base64, UDT / SSVariant fallback)
- Runtime version detection (
drivers/sqlserver/version.rs) with a conservative default major = 14 (SQL Server 2017) and feature gates for 2012 (OFFSET/FETCH) and 2017 (STRING_AGG)
- ER-diagram batch helpers (
get_all_columns_batch / get_all_foreign_keys_batch / get_schema_snapshot)
Phase 2 — open for contribution
Phase 3 — roadmap
Ground rules
- Clean-room implementation. Do not copy GPL-licensed code from other open source database clients. Tabularis stays Apache-2.0.
- Zero breaking changes for MySQL / Postgres / SQLite drivers or for saved connections. New model fields land as
Option<T> with #[serde(default)] and skip_serializing_if.
- Utilities ship with unit tests in the same PR. Pure functions — formatters, parsers, query builders, normalizers, SQL-string constants — get co-located
#[cfg(test)] mod tests { ... } coverage. No exceptions.
- Conservative version fallback. When runtime detection can't determine the server major version, default to 14 (SQL Server 2017) — modern enough to unlock
OFFSET/FETCH + STRING_AGG, old enough to cover the bulk of real-world installations.
Architecture primer
The driver lives in src-tauri/src/drivers/sqlserver/ on feat/sql-server:
| File |
Purpose |
pool.rs |
Custom deadpool::managed::Manager wrapping tiberius::Client over tokio TCP via tokio-util::compat |
helpers.rs |
bracket_quote / quote_identifier / qualify — all pure, all tested |
version.rs |
SERVERPROPERTY parsing + feature gates (supports_offset_fetch, supports_string_agg, supports_drop_if_exists) |
introspection.rs |
sys.* + INFORMATION_SCHEMA.* queries + pure build_table_column / build_foreign_key |
extract/mod.rs |
ColumnType-keyed dispatcher returning serde_json::Value |
extract/temporal.rs |
Pure chrono formatters for date / time / datetime / datetimeoffset |
The pagination split lives in src-tauri/src/drivers/common/query.rs::PaginationDialect (shared with MySQL / Postgres / SQLite via a legacy passthrough).
Getting started
- Spin up a local server:
docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=Strong!Pass123' \
-p 1433:1433 mcr.microsoft.com/mssql/server:2022-latest
- Clone Tabularis, switch to
feat/sql-server (the driver isn't on main), confirm the baseline:
git clone https://github.com/TabularisDB/tabularis.git
cd tabularis
git checkout feat/sql-server
cargo test --lib # 471 tests should pass
npm run typecheck
- Pick a sub-issue below (look for
good first issue and help wanted labels) and say hi in the comments before you start.
- Branch off
feat/sql-server, open a PR targeting feat/sql-server, reference this epic. Reviewers will check the "utilities with tests" invariant during review.
Questions, design pushback, alternative approaches → comment here or open a GitHub Discussion.
SQL Server driver — implementation roadmap & call for contributors
Status
Phase 1 is done on
feat/sql-server. Clean-roomtiberius+deadpool, peer to MySQL / PostgreSQL / SQLite. Not merged tomain. Not in any released build. The branch squashes intomainwhen Phase 2 closes via #149.Phase 2 (editing + TLS + composite keys) is open for contribution. Phase 3 (DDL + EXPLAIN + Azure AD) is on the roadmap.
471 Rust tests pass, zero regressions on the existing drivers.
Contributors: branch off
feat/sql-server, notmain. Target your PR atfeat/sql-server, notmain.Phase 1 — done on
feat/sql-serversrc-tauri/src/lib.rs, selectable from the Connection modalreadonly: truemanifest (INSERT / UPDATE / DELETE hidden in UI during the preview)deadpool+ a customtiberius::Manager(src-tauri/src/drivers/sqlserver/pool.rs)sys.*+INFORMATION_SCHEMA.*(tables / columns / FK / indexes / views / routines)execute_querywith dialect-aware pagination (PaginationDialect::OffsetFetch, added todrivers/common/query.rs)drivers/sqlserver/version.rs) with a conservative default major = 14 (SQL Server 2017) and feature gates for 2012 (OFFSET/FETCH) and 2017 (STRING_AGG)get_all_columns_batch/get_all_foreign_keys_batch/get_schema_snapshot)Phase 2 — open for contribution
ConnectionParamswith SQL Server-specific TLS/auth fields — [Phase 2] Extend ConnectionParams with SQL Server-specific TLS/auth fields #144commands.rsdelegation) — [Phase 2] CRUD composite primary keys (trait default methods) #145STRING_AGG+FOR XML PATHfallback) — [Phase 2] Foreign key composite aggregation (STRING_AGG + FOR XML PATH fallback) #146IDENTITY_INSERThandling for inserts on identity tables — [Phase 2] IDENTITY_INSERT handling for inserts on identity tables #147Phase 3 — roadmap
sp_rename,IDENTITY(1,1), default-constraint DROP+ADD dance)SHOWPLAN_XML)AuthMethod::AADToken)#[cfg(windows)])Ground rules
Option<T>with#[serde(default)]andskip_serializing_if.#[cfg(test)] mod tests { ... }coverage. No exceptions.OFFSET/FETCH+STRING_AGG, old enough to cover the bulk of real-world installations.Architecture primer
The driver lives in
src-tauri/src/drivers/sqlserver/onfeat/sql-server:pool.rsdeadpool::managed::Managerwrappingtiberius::Clientover tokio TCP viatokio-util::compathelpers.rsbracket_quote/quote_identifier/qualify— all pure, all testedversion.rsSERVERPROPERTYparsing + feature gates (supports_offset_fetch,supports_string_agg,supports_drop_if_exists)introspection.rssys.*+INFORMATION_SCHEMA.*queries + purebuild_table_column/build_foreign_keyextract/mod.rsColumnType-keyed dispatcher returningserde_json::Valueextract/temporal.rsThe pagination split lives in
src-tauri/src/drivers/common/query.rs::PaginationDialect(shared with MySQL / Postgres / SQLite via a legacy passthrough).Getting started
feat/sql-server(the driver isn't onmain), confirm the baseline:good first issueandhelp wantedlabels) and say hi in the comments before you start.feat/sql-server, open a PR targetingfeat/sql-server, reference this epic. Reviewers will check the "utilities with tests" invariant during review.Questions, design pushback, alternative approaches → comment here or open a GitHub Discussion.