Skip to content

Linux: add Microsoft SQL Server driver (tiberius) #1957

Description

@Seha16

Summary

Add a Microsoft SQL Server driver to the Linux port, implementing the "MSSQL via tiberius" item from linux/ROADMAP.md. SQL Server connectivity exists on macOS via a plugin; this brings it to the Linux (Rust + GTK4) build as a statically-linked driver crate, consistent with the no-plugin-system decision (docs/decisions/0001).

What's implemented

  • New crate crates/drivers/mssql (tablepro-driver-mssql) on tiberius (pure-Rust TDS) with rustls TLS (no OpenSSL).
  • Full core::Connection surface: connect (SQL auth, encryption from use_tls, trust-cert), list_tables, fetch_columns (PK / IDENTITY / computed / default via sys catalog), fetch_rows (OFFSET … FETCH pagination), query / query_params, execute / execute_params, execute_in_transaction, fetch_indexes, fetch_foreign_keys, ping, close.
  • TDS → Value mapping for all value variants; @P-style parameter binding; server errors mapped to DriverError (login-failed → AuthFailed).
  • Core dialect/DDL (sql_dialect.rs, sql_ddl.rs) gain mssql arms: [bracket] quoting, @Pn placeholders, IDENTITY(1,1), sp_rename, ALTER COLUMN, DROP INDEX … ON, DROP CONSTRAINT. Other engines are byte-for-byte unchanged.
  • Registered in the app; the registry-driven connection dialog shows "SQL Server" (default port 1433). Structure-tab type list + DDL transaction wrapping updated.

Testing

  • Unit tests for type/default/error mapping and every dialect/DDL builder.
  • Integration tests (testcontainers, #[ignore] behind Docker) passing against SQL Server 2022 (CU14): connect + introspection (PK/IDENTITY), all-types value roundtrip + parameter binding, OFFSET/FETCH pagination, error mapping.
  • cargo build --workspace, cargo test --workspace --lib, cargo fmt --all -- --check, cargo clippy --all-targets -- -D warnings all clean on the pinned 1.93 toolchain.

Known limitations

  • SQL Server authentication only (Windows/Kerberos auth is not modelled by ConnectOptions).
  • Column reorder is unsupported (MySQL-only, matches existing gating); an ALTER COLUMN that changes only a default is a no-op (MSSQL named-constraint management deferred).
  • XML columns surface as text; one connection per session, serialized by a mutex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions